dolf
dolf

Reputation: 43

How to use regex in notepad++ in this condition?

I want to search strings in notepad++ such as NullpointerException, AnotherException and all other exceptions except JmsException or ConnectException , but currently I have "(connect|jms)Exception" and its only searching JmsException and ConnectException. What do I add to this regex to make it work?

Upvotes: 1

Views: 69

Answers (2)

Toto
Toto

Reputation: 91518

Have a try with:

Find what: (?<!Jms)(?<!Connect)Exception

Make sure that Regular Expression is checked.

(?<!....) is a negative lookbehind

Upvotes: 1

Khaleel
Khaleel

Reputation: 1371

Use (?Exception)(!connect|jms(Exception))(\w+)

Upvotes: 1

Related Questions