繁体   English   中英

正则表达式搜索和Sublime Text 2中的替换

[英]Regex search & replace in Sublime Text 2

我有一个包含此内容的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搜索和替换功能,将双换行符替换为<br><br> 救命?

我用提供的行在Sublime Text 2中复制了两次尝试了这一点,它似乎可以正常工作:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM