I want to use notepad++ and regex to find a line that contains the word g_n
and does not contain the word thd
.
I've been desperately trying to figure this out but with little luck. Can someone point me in the right direction? It would be greatly appreciated.
I know that I can use ^ to negate something.
It can be invoked directly with Search > Find or the keyboard shortcut Ctrl+F. Replace tab: Similar to Find tab, but allows you to replace the matched text after it's found. It can be invoked directly with Search > Replace or the keyboard shortcut Ctrl+H.
Finding text in Notepad and WordPad The Ctrl + F and Command + F keyboard shortcut keys also work in Microsoft Notepad and Microsoft WordPad.
Using Regex to find and replace text in Notepad++ In all examples, use select Find and Replace (Ctrl + H) to replace all the matches with the desired string or (no string). And also ensure the 'Regular expression' radio button is set.
I would imagine that this regex would work:
^(?!.*thd).*g_n.*$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With