Notepad++ Regex查找包含单词而不包含单词的行

时间:2021-07-12 19:14:32

I want to use notepad++ and regex to find a line that contains the word g_n and does not contain the word thd.

我想使用notepad++和regex找到一个包含单词g_n而不包含单词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.

我知道我可以使用^否定一些东西。

1 个解决方案

#1


12  

I would imagine that this regex would work:

我可以想象这个regex会工作:

^(?!.*thd).*g_n.*$

#1


12  

I would imagine that this regex would work:

我可以想象这个regex会工作:

^(?!.*thd).*g_n.*$