Say I have a sentence:
I am a good buy and bad boy too
How to select every word except boy in this sentence using regular expression ?
You can use negative look behind:
\w+\b(?<!\bboy)
Or negative look ahead since not all support negative look behind
(?!boy\b)\b\w+
You can read about negative look ahead here