Reputation: 53
I have an XML Wordpress file that contains this (actually many of these, each with multiple paragraphs/line breaks):
<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>
I need a regex that will only search within the <content:encoded></content:encoded>
tags and replace the double line breaks with <br><br>
, using Sublime Text 2 search & replace. Help?
Upvotes: 1
Views: 60
Reputation: 51
I tried this with the provided line copied twice in Sublime Text 2 and it seems to be working:
Search for: (<content:encoded>.*)\n*(.*</content:encoded>)
And replace it with: \1<br><br>\2
Upvotes: 1