in reply to Substitution Problem
The '.' metacharacter doesn't match newlines by default. You'll need to add the s pattern modifier to make it do that. You may want to add the i modifier as well to make it case-insensitive if you don't know that the HTML tags are all uppercase:
s{<FORM(.*?)/FORM>}{replacement text}is;
It may also be worth noting that if the HTML is not well formed you could end up removing a heck of a lot more than you intended using this regexp
Update: Whoops. Quite right davido. I assumed that everything was in a single scalar variable. Additionally, for a quickie list of regexp modifiers you can go to perlreref.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Substitution Problem
by perldeveloper (Scribe) on Jul 10, 2004 at 15:54 UTC | |
by meraxes (Friar) on Jul 10, 2004 at 22:44 UTC | |
by perldeveloper (Scribe) on Jul 10, 2004 at 23:47 UTC |