I want to match and expression that contains the string yes
, but only if it's not preceded by the string no
.
For example, this with match:
Hello world, major yes here!
But this will not match: Hell no yes
The second string does not match because the yes
string is preceded by no
string. Apparently this needs negated lookbehind, which is not implemented in JavaScript regex flavor, I've tried stuff like that:
/((?!no ))yes/
/^(?!.*no) yes$/
but they don't seem to have the desired effect :/