I want to match strings containing MYSTUFF
in all cases, except when MYSTUFF
is preceded by ENABLED_
. So that the following would match:
MYSTUFF
m_MYSTUFF
MYSTUFFIsGreat
allOf_MYSTUFF
but the following wouldn't:
ENABLED_MYSTUFF
m_ENABLED_MYSTUFF
ENABLED_MYSTUFFIsGreat
allOf_ENABLED_MYSTUFF
I tried several variations using negative lookahead (variations of \w*(?!.*ENABLED_)MYSTUFF\w*
), and conditional (variations of (?(?!=ENABLED_)(MYSTUFF))
), but I did not manage to get the results I'm after.
Is what I want even doable with regexes?