Hope I can explain this one.
I've got a regex for matching two words near each other. For example, if I want to find the word "account" and "number" within 5 words of each other:
\baccount\W+(?:\w+\W+){1,6}?number\b
This works perfectly.
Now I need to find a way to search for a word as long as it is NOT within 2 words of another word.
For example, I need a regex that matches "Butthead" but only if "Beavis" is not within 2 words, either BEFORE OR AFTER Butthead.
So Butthead and Beavis would not match. Beavis and Butthead would not match. But Beavis Sure Is a Giant Butthead would match because Beavis and Butthead are NOT within 2 words.