I’m trying to match a string ‘test’, it can only be matched if it’s not directly preceded by ‘no’ with any number of spaces after ‘no’.
So this underlined should match:
Bla bla test
Bla no bla test
Bla no test
bla bla no test
m = re.search('[^no *]test', line)
The problem is my code does not match 'test' if no characters are preceded by 'test'.
so '<space>test' does match and 'test' will not. What am I missing?