Reputation: 12872
I'm using Sublime Text for some search&replace operations. This is an example I'm trying to replace
<blockquote><pre><font face="verdana,arial,helvetica" size="1">code:</font><hr><font size="3">
<h1>Stuff</h1>
<p>More stuff and a <a href="#">link</a></p>
<!-- and any HTML really -->
</font><hr></pre></blockquote>
to look like this
<blockquote>
<h1>Stuff</h1>
<p>More stuff and a <a href="#">link</a></p>
<!-- and any HTML really -->
</blockquote>
The following pattern works as long the HTML inside the blockquote
is single line only.
Search:
<blockquote><pre><font face="verdana,arial,helvetica" size="1">code:</font><hr><font size="3">(.*?)</font><hr></pre></blockquote>
Replace:
<blockquote>$1</blockquote>
How can I make this work for multiple lines within the blockquote
?
Edit: I came across <tag>([\s\S]*?)</tag>
as well, but that includes the opening/closing tag
Upvotes: 3
Views: 8187
Reputation: 12872
I ended up using (?:<tag>)([\s\S]+?)(?:</tag>)
, but I'm sure there's a more efficient way to achieve the same
Upvotes: 12