0

I want to find all instances where

wx.data.xxx

but not

wx.data.update OR wx.data.get

I tried (wx.data.)[^update][^get] but it doesn't work.

Aero Wang
  • 8,382
  • 14
  • 63
  • 99

2 Answers2

0

Use negative lookahead instead of a negative character set:

wx\.data\.(?!update|get)[^.\n]+

https://regex101.com/r/chy79T/1

CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
0

You could use (?! negative lookahead asserting what is on the right is not get or update.

\S+ matches 1+ times a non whitespace char. If you don't want to match a dot and a whitespace as well, you could use [^.\s]+

\bwx\.data\.(?!get|update)\S+

Regex demo

If for example updates or gets is allowed, you could add a word boundary \b

\bwx\.data\.(?!(?:get|update)\b)\S+
The fourth bird
  • 154,723
  • 16
  • 55
  • 70