I am trying to learn RegEx and build a regular expression that would look whether specified word is NOT in the provided string. So far I did try Regular Expression Info and RexxEgg all this tested on Regular Expression Online but I did not find the answer to my question.
I have tried conditionals and lookarounds. Let's say I want to build an expression to test against not existing word myword and pass expression when the word is NOT in the string. I used expression
(?(?!myword).*)
but RegEx passes regardless the word myword meaning both strings This is the text
and This is myword the text
pass the test.
Using negative lookahead and conditions is used to test that condition is true when myword does not exist. Lookahead is also zero length and therefore .*
would return the whole string.
Hope someone can help :)