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

相关推荐
ShenJLLL1 小时前
vue部分知识点.
前端·javascript·vue.js·前端框架
恋猫de小郭2 小时前
你是不是觉得 R8 很讨厌,但 Android 为什么选择 R8 ?也许你对 R8 还不够了解
android·前端·flutter
PineappleCoder2 小时前
告别“幻影坦克”:手把手教你丝滑规避布局抖动,让页面渲染快如闪电!
前端·性能优化
武帝为此3 小时前
【Shell变量替换与测试】
前端·chrome
CappuccinoRose3 小时前
CSS 语法学习文档(十九)
前端·css·属性·flex·grid·学习资源·格式化上下文
雷电法拉珑3 小时前
财务数据批量采集
linux·前端·python
We་ct4 小时前
LeetCode 105. 从前序与中序遍历序列构造二叉树:题解与思路解析
前端·算法·leetcode·链表·typescript
前端 贾公子4 小时前
深入理解 Vue3 的 v-model 及自定义指令的实现原理(下)
前端·html
Roc.Chang5 小时前
Vite 启动报错:listen EACCES: permission denied 0.0.0.0:80 解决方案
linux·前端·vue·vite