Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
它的源代码包含如下部分:
<pre> text </pre> long long text <pre> text </pre> long long text
我必须找到这个条目
<pre> text </pre>
在 JEdit 中并用空格替换它。(我阅读了JEdit 文档中的正则表达式规则。)
我的表达是:
<pre>([\.\n]*?)</pre>
但它找不到入口。
什么表达应该是正确的?
在您的正则表达式中.,将按字面意思处理,而不是作为元字符来匹配除换行符以外的任何字符。
.
尝试:
<pre>(.|\n)*?</pre>
由于未指定操作系统,因此换行符可以由 a \n(Unixes) 或 a \r\n(windows) 表示。无论哪种情况,您都可以使用:
\n
\r\n
<pre>(.|\r?\n)*?</pre>