Page 1 of 1

Use of $1-$9 in replace

Posted: Thu Feb 12, 2009 4:21 am
by Tim
Can you give a find and replace example using $1-$9. I can't get it to work the way I think it should.

Posted: Thu Feb 12, 2009 10:01 am
by DV

The capturing groups are defined by parentheses ().

example -

RegEx - <img src="(.*?)">
Replace - <img src="$1" alt="$1">

Input Text = <img src="test.jpg">
Result = <img src="test.jpg" alt="test.jpg">

Posted: Thu Feb 12, 2009 11:30 pm
by Tim
Thanks DV.

The () in the search field was what I was missing. I will try it later tonight.