简体   繁体   English

在 Notepad++ 中查找不包含 2 个字符中的 1 个的行

[英]Find lines that do not contain 1 of 2 characters in Notepad++

how can i find lines that NOT contain either chars ;我怎样才能找到不包含任何一个字符的行; or : ?:

i only know to find line without one of them by regex ^[^\\:]*\\r\\n我只知道通过正则表达式找到没有其中之一的行^[^\\:]*\\r\\n

thanks!谢谢!

With the following, you can select blocks of consecutive lines that do not contain those characters:使用以下内容,您可以选择不包含这些字符的连续行块:

^[^:;]*$

For the following input file, this regular expression will select lines 1-2, 4-6, 8-9 (skipping line 3 and 7, which contain the excluded characters).对于以下输入文件,此正则表达式将选择第 1-2、4-6、8-9 行(跳过第 3 行和第 7 行,其中包含排除的字符)。

1
2
3A : 3B
4
5
6
7A ; 7B
8
9

You'll want to use a ?!你会想要使用 ?! for negative lookahead.为负前瞻。

I like to use this site to try out regex I write.我喜欢使用这个网站来尝试我写的正则表达式。 https://regex101.com/ https://regex101.com/

https://www.regular-expressions.info/refadv.html https://www.regular-expressions.info/refatv.html

I am the developer of EmEditor.我是 EmEditor 的开发者。 If you use EmEditor, you can enter [;:] to the Filter toolbar, and turn on both Use Regular Expression and Negative buttons.如果您使用 EmEditor,您可以在过滤器工具栏中输入[;:] ,然后打开使用正则表达式否定按钮。 Filter toolbar in EmEditor EmEditor 中的过滤器工具栏

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

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