Notepad++ 多行正则表达式 [英] Notepad++ multiline regex

查看:69
本文介绍了Notepad++ 多行正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此处链接了数百个此类文件:http://pastebin.com/fGgLfZf8

I've got hundreds of files of the type linked here: http://pastebin.com/fGgLfZf8

但是我想删除所有占用多于一行的评论例如.

But I want to remove all the comments that occupies more than one line eg.

<!--- MPU ---> 

应该保持不变,而

<!--
************
blablabla
************
-->

应该删除.

我知道 Notepad++ 功能不仅可以使用正则表达式查找文档,而且我正在尝试使用它,但我遇到了一些困难.首先,我正在尝试这个正则表达式:

I know the Notepad++ feature to lookup through more than a document with regexp and I'm tryin to use it but I have some difficulty. For a start I'm trying this regexp:

<\!\-\-(.*?)\-\->

在这里测试:http://www.regextester.com/ 至少部分有效(因为它突出了在线发表的评论)但是,如果我将这个正则表达式复制并粘贴到 Notepad++ 上,它将仅匹配一行注释 =\

which tested in here: http://www.regextester.com/ works at least partially (because it highlights the comments made of just on line) But if I copy and paste this regexp on Notepad++ it will match just the one-line comments =\

有人知道如何在 Notepad++ 中执行此操作吗?

Does anybody know how to do this in Notepad++?

推荐答案

在搜索模式"中的正则表达式"选项旁边有一个匹配换行符"复选框(根据@glatapoui 应注意,这仅适用于 Notepad++ v6,不适用于以前的版本).

Next to the "Regular expression" selection in "Search Mode" there is a "matches newline" checkbox (according to @glatapoui it should be noted that this only works in Notepad++ v6, not in previous versions).

这篇关于Notepad++ 多行正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆