正则表达式搜索&在Sublime Text 2中替换

时间:2015-12-04 19:00:14

标签: regex wordpress

我有一个包含这个的XML Wordpress文件(实际上很多,每个都有多个段落/换行符):

<content:encoded><![CDATA[We read a lot of <strong>stuff</strong> these days. We're bombarded with emails, text messages, blogs, snail mail, junk mail, recipes, pollen counts, newspapers, CNN tickers, Facebook statuses, Tweets and more.

But do we take the time to read <em>important</em> documents when they pass through our hands? Sometimes.]]></content:encoded>

我需要一个仅在<content:encoded></content:encoded>代码中搜索的正则​​表达式,并使用Sublime Text 2搜索&amp;替换双重换行符<br><br>。更换。帮助

1 个答案:

答案 0 :(得分:1)

我尝试使用在Sublime Text 2中复制两次的提供的行,它似乎正在工作:

搜索:(<content:encoded>.*)\n*(.*</content:encoded>)

并将其替换为:\1<br><br>\2