簡體   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