html - How do I replace one character with another but ONLY in href? -


i have hundreds of links in below format:

a href="../lorem_ipsum__"  title="dolor_sit amet" target="__blank" 

i need change _ (underscore) character - (hyphen), in href (title , target need remain unchanged).

i tried dreamweaver's 'find , replace', didn't succeed.

tick "use regular expression" in find , replace, search for:

(href="[^_"]*)_+([^"]*) 

and replace with:

$1-$2 

the first parenthesis group searches starts href=", characters except _ or ".

then have _ 1 or more times.

the second parenthesis group searches , stops before closing "

you can use groups $1 , $2 in replace.

here's interactive tutorial if want learn regular expressions (regex): http://regexone.com/


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -