Check for upper/lowercase letters in regex: `/[A-Z]|[a-z]/`

Rewrite:

Check for Occurrences of Uppercase or Lowercase Strings

The following strings should be checked:

1a
2A
3aC

JavaScript Code

The following JavaScript code can be used to check for occurrences of uppercase or lowercase strings:

const str = '1a'
/[a-z]/.test(str) //Pass
/[a-z][A-Z]/.test(str) //Fail
/[a-z]/.test(str) //Pass

Check for Occurrences of Uppercase or Lowercase Strings

The following strings should be checked:

1a
2A
3aC

JavaScript Code

The following JavaScript code can be used to check for occurrences of uppercase or lowercase strings:

const str = '1a';
console.log(/[a-z]/.test(str)); // true
console.log(/[A-Z]/.test(str)); // false
console.log(/[a-zA-Z]/.test(str)); // true