I am having trouble trying to write a regular expression in JavaScript that can detect a whole word of at least 2 characters that is typed in all CAPS.
This is what I have tried and it seems to work .
/\b[^\Wa-z0-9_]+\b/
however, I will detect if a user starts a string “I like you.”
Since, I is capitalized it returns true, hence why I want to only detect words that are all caps of more then 2 letters.
1 Answer