in reply to Re^2: regex: Need help substituting
in thread regex: Need help substituting
I'm just curious as to why you're using the many if statements.
I suppose the following should work:
Note the use of the 'g' modifier.$data=~ s{<rstate>[^<\n]+</rstate>}{<rstate>$new_text</rstate>}g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regex: Need help substituting
by the_perl (Initiate) on Apr 09, 2012 at 14:36 UTC | |
by Joe_ (Beadle) on Apr 09, 2012 at 20:27 UTC |