查找不以 " 开头的行在记事本++中 [英] Find lines not starting with " in Notepad++
问题描述
我尝试验证存在换行问题的 CSV 文件.
I try to verify a CSV file where we had problems with line breaks.
我想找到所有不以 "
开头的行.
I want to find all lines not starting with a "
.
我正在尝试使用 /!^"/gim
但 !
否定不起作用.
I am trying with /!^"/gim
but the !
negation is not working.
如何正确否定/^"/gim
?
推荐答案
在正则表达式中,!
并不意味着否定;相反,您想用 [^"]
否定一个字符集.括号 []
表示一个字符集,如果它以 ^
表示不是这个字符集".
In regex, the !
does not mean negation; instead, you want to negate a character set with [^"]
. The brackets, []
, denote a character set and if it starts with a ^
that means "not this character set".
所以,如果你想匹配不是双引号的东西,你可以使用 [^"]
;如果你不想匹配任何引号,你可以使用 [^"']
等
So, if you wanted to match things that are not double-quotes, you would use [^"]
; if you don't want to match any quotes, you could use [^"']
, etc.
使用 Notepad++,您应该能够使用以下内容进行搜索以查找不以 "
字符开头的行:
With Notepad++, you should be able to search with the following to find lines that don't start with the "
character:
^[^"]
如果要突出显示整行,请使用:
If you want to highlight the full line, use:
^[^"].*
这篇关于查找不以 " 开头的行在记事本++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!