【发布时间】:2017-02-01 19:09:03
【问题描述】:
我有一个 XML 代码:
<Line1>Matched_text Other_text</Line1>
<Line2>Text_to_replace</Line2>
如何告诉 Notepad++ 找到Matched_text 并将Text_to_replace 替换为Replaced_text?有几个相似的代码块,一个正好是Matched _text,另一个是Other_text 和Text_to_replace。我想一次性全部替换。
我的想法是放
Matched_text*<Line2>*</Line2>
在“查找”字段中,并且
Matched_text*<Line2>Replaced_text</Line2>
在替换字段中。我知道正则表达式中的\1 可能有用,但我不知道从哪里开始。
实际代码是:
<Name>Matched_text, Other_text</Name>
<IsBillable>false</IsBillable>
<Color>-Text_to_replace</Color>
【问题讨论】:
标签: regex xml replace notepad++