Sublime Text regex to isolate an achor tag

I’m looking for a Sublime Text regular expression that will enable me to find and replace all anchors within an HTML file.

For example:

<a href="#Menu">menu</a>) the <a href="http://en.wikipedia.org/wiki/Breadcrumb_(navigation)">

I’ve tried this but it finds all links and anchors – I just want anchors:

(?i)<a([^>]+)>(.+?)</a>

I’ve also tried this but it selects two nearby a tags and everything in between:

(<a href="#)(.*)("{1})>


Source: regex

Leave a Reply