regex match uppercase and lowercase js code example
Example 1: regex only uppercase letters js
if (value.match(/^[A-Z]*$/)) {
// matches
} else {
// doesn't match
}
Example 2: regex for lowercase letters js
function hasLowerCase(str) {
return (/[a-z]/.test(str));
}