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>"

相关推荐
传人1 小时前
悬停旋转放大和位移效果如何写
前端·javascript·css
Frag0ut1 小时前
Chrome Dev 最新功能更新:AI 智能体开发工具、HTML-in-Canvas 与双周更新节奏
chrome·google·dev·webmcp·最新功能·双周更新
zhangzeyuaaa2 小时前
Ruby 方法参数完全指南:默认值、可变参数与关键字参数
前端·python·ruby
粥里有勺糖2 小时前
视野修炼-技术周刊第135期 | 鼠标跟随宠物
前端·github·aigc
H.莓飛2 小时前
【Linux】命令行参数、环境变量与程序地址空间
linux·c语言·chrome·后端·centos
粥里有勺糖2 小时前
拿 Codex 协助清理磁盘,Nice!
前端·后端·github
Highcharts.js2 小时前
可视化商用图表库对比,如何选择?
前端·javascript·学习·信息可视化·highcharts·前端可视化
TheITSea3 小时前
JavaScript Web APIs
开发语言·前端·javascript
恋猫de小郭3 小时前
Android CLI 支持 AI Agent 通过 Device Streaming 调试云真机
android·前端·flutter
Wang's Blog3 小时前
Java 项目实战: 外卖平台优化-前端dist部署与Nginx反向代理rewrite
java·前端·nginx