【发布时间】:2017-06-07 21:29:39
【问题描述】:
我正在使用 notepad++ 并尝试用特定标记内的另一个单词查找/替换 XML 文件中出现的特定单词。
例如: XML 文件包含
<alerts>
<ccEmails>abc@example.com,xyz@example.com</ccEmails>
<toEmails>mnp@example.com</toEmails>
</alerts>
我需要将 example 替换为存在 inside<ccEmails> 但 not inside<toEmails>
我在https://regex101.com/r/Q8UB6a/1 尝试了ccEmails.*(example).*ccEmails,它只返回最后一次出现。另外,我无法用另一个字符串替换那里的字符串。
当我在记事本++中尝试这个时,我得到了<ccEmails>中的所有字符串
您能帮我查找/替换特定标签中包含的子字符串吗?如果需要更多详细信息,请告诉我。
【问题讨论】:
标签: regex string replace notepad++