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

相关推荐
超哥--6 小时前
B站视频内容智能分析系统(九):React 前端与管理面板
前端·react.js·前端框架
Cutecat_9 小时前
视频字幕处理工具横向:提取模式 vs 编辑模式,该如何选择
android·前端·ios·语音识别
qq_422152579 小时前
PDF 加水印工具怎么选?2026 年文档版权保护方案对比
前端·pdf·github
kyriewen10 小时前
手写 Promise.all、race、any:不到 30 行代码,解决并发异步的所有姿势
前端·javascript·面试
allway210 小时前
How to Echo Multiline to a File in Bash [3 Methods]
开发语言·chrome·bash
brucelee18610 小时前
OpenClaw 浏览器控制(Chrome MCP)完整教程
前端·chrome
ct97811 小时前
React 状态管理方案深度对比
开发语言·前端·react
胡志辉的博客11 小时前
深入浅出理解浏览器事件循环:从一道输出题讲到 Chrome 源码
前端·javascript·chrome·chromium·event loop
代码不加糖11 小时前
js中不会冒泡的事件有哪些?
前端·javascript·vue.js
懂懂tty11 小时前
Vue2与Vue3之间API差异
前端·javascript·vue.js