I'm looking for all instances of a certain character in a string of text except for when it is both prefixed and suffixed a certain way.
A simple example of this would be to find all instances of "a" in the string "I am a cat in a hat in a car" except where it appears in the word "cat":
I am acatin a hat in a car
Combining a negative lookbehind assertion and a negative lookahead assertion doesn't seem to work because it fails when either of the assertions are triggered rather than only when both are triggered.
Using a regex to find "a"s but ignore "ca"s ignores the word "car":
/(?<!c)a/g
I am acatin a hat in acar❌
Using a regex to find "a"s but ignore "at"s ignores the word "hat":
/a(?!t)/g
I am acatin ahat❌ in a car
Combining the two ignores both "car" and "hat":
/(?<!c)a(?!t)/g
I am acatin ahat❌ in acar❌
Regex seems to NOR the two assertions, is it possible to NAND them?