Search code examples
regexsublimetext3

Sublime regular expression to match wx.data.xxx but not wx.data.yyy


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.


Solution

  • Use negative lookahead instead of a negative character set:

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

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