regex only uppercase letters js
if (value.match(/^[A-Z]*$/)) {
// matches
} else {
// doesn't match
}
regex only uppercase letters js
if (value.match(/^[A-Z]*$/)) {
// matches
} else {
// doesn't match
}
js reg expression pick uppercase
const str = "HERE'S AN UPPERCASE PART of the string";
const upperCaseWords = str.match(/(\b[A-Z][A-Z]+|\b[A-Z]\b)/g);
// => [ 'HERE', 'S', 'AN', 'UPPERCASE', 'PART' ]
/*\b - start of the word
[A-Z] - Any character between capital A and Z
[A-Z]+ - Any character between capital A and Z,
but for one of more times and without interruption
| - OR
\b - start of the word
[A-Z] - Any character between capital A and Z
\b - end of the word
g - global (run multiple times till string ends,
not just for one instance)*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us