I am looking for a way to match a string only if it is not a substring of another string.
Example:
I need to find if text contains string "bbbb" that is not part of a string "aaaabbbbcccc".
The regular expression should match the lines:
aaabbbbcccc aaaabbbbccc aaabbbbccc bbbbcccc aaaabbbb
but does not match:
aaaabbbbcccc
I tried to do this using search queries:
(?<!aaaa)bbbb(?!cccc)
but that will not work. It only matches
aaabbbbccc
source share