D
David Deutsch
I am trying to write a regular expression that will do a substitution
repeatedly until there are not more matches. Specifically, let's say I want
to convert every <option> tag in a select with name "YYY" into a link. If I
use:
s|(<select name="YYY">)<select.*?>(.*?)</select>|$1<a href =
"$2">$2</a>|gs
it will only change the first select (sorry if my syntax is not quite
correct). Is there a directive I could give in this regex that will do the
substitution over and over until there are no more patterns to substitute?
Thanks,
Dave
repeatedly until there are not more matches. Specifically, let's say I want
to convert every <option> tag in a select with name "YYY" into a link. If I
use:
s|(<select name="YYY">)<select.*?>(.*?)</select>|$1<a href =
"$2">$2</a>|gs
it will only change the first select (sorry if my syntax is not quite
correct). Is there a directive I could give in this regex that will do the
substitution over and over until there are no more patterns to substitute?
Thanks,
Dave