-1

Lets say i have some random easy match like

\bword\b

Now i want to add to this that if before this match there is lets say this

(HOUSE[ ]*?)\bword\b

So if the word HOUSE and whatever ammount of spaces is infront of word then the match should be false. So my question more or less is how do i negate the (HOUSE[ ]*?) query?

Vajura
  • 1,054
  • 7
  • 15

1 Answers1

2

You use a negative lookbehind. In .NET lookbehinds can be variable length:

(?<!HOUSE[ ]*?)\bword\b

Reference:

Community
  • 1
  • 1
HamZa
  • 13,530
  • 11
  • 51
  • 70