I have to search a string for a few words eg, dog, cat, lion but I want regex to fail if lizard is found in the string even if it contains cat, dog or lion.
ismatch(pass) "dog|cat|lion" "This is not your average cat!"
ismatch (fail) [my regex statement] "This is not your average cat! It's a lizard."
[my regex statement] - here the regex statement is unknown, can you please help me to write this statement?
Word spaces and boundaries or lower/uppercase is not a concern. I run the string through
Replace(" ", "").Trim(" ").ToLower
before handover to Regex.