[英]Notepad++ Find strings 50 characters or longer between two vertical bars
I would like to ask for help with the regular expression to use in Notepad ++ that will find any text that is 50 or longer, and is between 2 vertical bars?我想就在记事本 ++ 中使用的正则表达式寻求帮助,它会找到 50 或更长的任何文本,并且在 2 个竖线之间?
Example:例子:
060801113494|I am writing a string that is longer that 50 characters|1054.70|2020-12-10 10:27:20|My Test|10511078
I saw some examples and have this version, but it is not working:我看到了一些示例并拥有此版本,但它不起作用:
\|(?:(?!\|).){50,}
The string can contain special characters.字符串可以包含特殊字符。
Thank you, Erasmo谢谢你,伊拉斯莫
The pattern \|(?:(?.\|),){50,}
matches the leading |
模式\|(?:(?.\|),){50,}
匹配前导|
and does not make sure that there is a closing one.并且不确保有一个关闭的。
You can match a pipe, then forget what is matched so far and continue matching 50 or more chars other than a |
您可以匹配 pipe,然后忘记到目前为止匹配的内容并继续匹配除|
之外的 50 个或更多字符while asserting one at the end.最后断言一个。
\|\K[^|]{50,}(?=\|)
Explanation解释
\|
Match a |
匹配一个|
\K
Forget what is matched so far \K
忘记到目前为止匹配的内容[^|]{50,}
Match 50+ times any char except |
[^|]{50,}
匹配除|
以外的任何字符 50 次以上(?=\|)
Positive lookahead, assert a |
(?=\|)
正向前瞻,断言 a |
at the right在右边
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.