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

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -