Is it possible to use a regex to create a pattern that matches fragments that do NOT contain a certain string?
This magic regex would take this input and examine whats between the parenthesis:
(foo bar) (barfoo) (zab) (foozab) and only return zab because it doesn’t contain foo between the parenthesis.
Is this possible, or should I just capture everything between parenthesis and use a langauge function to exclude them?
Depending on the engine, you can use a lookahead assertion.
That regex will match a parenthesized string where the characters inside the string do not ever match the sub-expression “foo” (which in this case is just a string).
Here it is in expanded form: