in reply to Re: Regular Expressions
in thread Regular Expressions
You are using a greedy regex there, and s/<body[^>]*>/$1$blah/gi; will probably grab more than you want.
s/<body[^>]*?>/$1$blah/si;This would be sufficient, and with the s modifier, it will account for <body> spanning multiple lines. I didn't use g, as I doubt you want to match <body> on a global scale.
Peace
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regular Expressions
by mrborisguy (Hermit) on Jun 20, 2005 at 13:25 UTC |