简体   繁体   English

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

[英]Notepad++ Regex Find line containing a word and not containing a word

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. 我知道我可以使用^来否定某些东西。

我想这个正则表达式会起作用:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM