Does anyone know how to use regex to replace string in dreamweaver?
Basically I want to change
.htm?” to .htm?” rel=”nofollow”
I can find the string I am looking for in dreamweaver no problem
\.htm\?(.*?)\"
The above code finds the above string perfectly. However I think I am maybe getting a little confused with the replace part.
If I use the code
.htm?(.*?)" rel="nofollow"
In the replace section it replaces with exactly that. Is there some way I can get it to keep my parameter string?
Thanks for looking!
What you want is a capturing group. Incidentally you already have one. Parentheses capture whatever was matched inside them. Since you only have one set of parentheses, the capturing group is indexed with number
1.Try this replacement string:
Alternative,
$0corresponds to the full match. So you could as well replace this withEDIT: I cannot find anyone using
$0in Dreamweaver right now. If it does not work, capture your whole match:And replace it with