I am trying to write a replacement regular expression to surround all words in quotes except the words AND, OR and NOT.
I have tried the following for the match par
John,
The regex in your question is almost correct. The only problem is that you put the lookahead at the end of the regex instead of at the start. Also, you need to add word boundaries to force the regex to match whole words. Otherwise, it will match "nd" in "and", "r" in "or", etc, because "nd" and "r" are not in your negative lookahead.
(?i)\b(?!and|not|or)(?[a-z0-9]+)\b