sublimetext3 - Sublime Text regex to isolate an achor tag -


i'm looking sublime text regular expression enable me find , replace anchors within html file.

for example:

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

i've tried finds all links , anchors – want anchors:

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

i've tried selects 2 nearby tags , in between:

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

here's eventual solution came with:

(<a href="#)([^"]+)("{1})> 

this allows me replace anchors so:

$1" onclick="alert('yay')"> 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -