ultraEdit正则匹配多行(xml用)

在ultraEdit中,我想选取<channel到</channel>之间的多行(进行删除)。在perl模式下,命令为"<channel[\s\S]+?</channel>"。下面是xml文件:

<!--This XML file does not appear to have any style information associated with it. The document tree is shown below.-->

<tv generator-info-name="http://epg.51zmt.top:8000" generator-info-url="QQ 31849627">

<channel id="1">
<display-name lang="zh">CCTV1</display-name>
</channel>

<channel id="2">
<display-name lang="zh">CCTV2</display-name>
</channel>

<programme start="20230917213000 +0800" stop="20230917220000 +0800" channel="591">

<title lang="zh">东方飞鹰</title>

</programme>

<programme start="20230917220000 +0800" stop="20230917230000 +0800" channel="591">

<title lang="zh">香港往事</title>

</programme>

</tv>

步骤1:ctrl+R,调出查找页面,输入查找字符"<channel[\s\S]+?</channel>"

我们将查找到第1个结果,

步骤2:

既然我们查找到了正确结果,我们可以选择"全部替换"来删除这些所有内容。

同理,我们用该命令也能查找1行内的内容,比如"<desc\s\S]+?</desc>",但是结果可能会出错,因为有<desc lang="zh"/>的时候,会匹配多行到</desc>结尾处。

二、删除多行注释

/\*[\s\S]+?\*/ 删除所有/* */,文件内容:

/*/bb0227e

123

//123

*/

<div class=\

则会匹配到

备注:

\s 空白 [ \r\t\n\f]

\S 非空白 [^ \r\t\n\f]

三、在一行内查找

还是用ultraEdit模式,正则"<desc*?</desc>"

相关推荐
顾安r22 分钟前
11.8 脚本网页 打砖块max
服务器·前端·html·css3
倚栏听风雨23 分钟前
typescript 方法前面加* 是什么意思
前端
狮子不白31 分钟前
C#WEB 防重复提交控制
开发语言·前端·程序人生·c#
菜鸟‍31 分钟前
【前端学习】阿里前端面试题
前端·javascript·学习
Jonathan Star34 分钟前
LangFlow前端源码深度解析:核心模块与关键实现
前端
用户479492835691540 分钟前
告别span嵌套地狱:CSS Highlights API重新定义语法高亮
前端·javascript·css
无责任此方_修行中1 小时前
一行代码的“法律陷阱”:开发者必须了解的开源许可证知识
前端·后端·开源
合作小小程序员小小店1 小时前
web网页开发,在线物流管理系统,基于Idea,html,css,jQuery,jsp,java,SSM,mysql
java·前端·后端·spring·intellij-idea·web
GISer_Jing2 小时前
OSG底层从Texture读取Image实现:readImageFromCurrentTexture
前端·c++·3d
Charles_go2 小时前
C#8、有哪些访问修饰符
java·前端·c#