Hi FOBioPatel,
Welcome to the forum!
In addition to abareplace's comment (you would use \b around some words or the equivalent syntax for your regex engine), here are some suggestions on your rev.
- it looks like each of your character classes contains the same upper- and lower-case letter, maybe your regex engine has a "case-insensitive" mode?
- you have a + after each character class, meaning "one or several" of the elements in the class. This makes sense to me for repeated letters such as the G, but are you sure you want that everywhere?
- your last two patterns have (parentheses) which (i) result in the capture of a string of esses in Group 1 (unneeded I assume) and (ii) are not needed for the regex to function.
- your last two patterns have a "?+" modifier, which I am fairly sure is not what you intend. The ? makes the esses optional, the + makes the group of esses atomic. Guessing that your intent is to make the s optional, a simple ? would be enough.
As a way of example, in case-insensitive mode (if available), your first regex could be simplified to this:
Code:
n[!1iI]g+[3ueaUEA]rs?
Here, we're not using word boundaries because you'd be happy to match that pattern even when embedded in more characters.
Also, you can drop the s?, because once you're past the R, you know you have a match:
Code:
n[!1iI]g+[3ueaUEA]r
Let us know if you need more help with this.
Wishing you a fun week.
