I'm looking for a regex which match words with a specific pattern (see below) but which doesn't contain one of three specific words
The pattern is
TEST won't match
TES$ won't match
SPECIFIC1 won't match
NON-SPECIFIC2 won't match
SPECIFIC2 won't match
MATCHES will match
test will match
If you surround the expression with
$ you can put the negative lookahead together with your character class to accomplish this.
Here's a demonstration. Note that this uses the flags global and multiline so I can have one match per row for demonstration purposes.
$ the pattern can just be shifted to avoid matching the forbidden strings.