Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Regular Expressionsby Adrade (Pilgrim) |
on Jun 20, 2005 at 04:32 UTC ( [id://468223]=note: print w/replies, xml ) | Need Help?? |
If I understand you correctly, you want to match a body tag whether or not its comes with modifiers. You want to strip the \s from within your regex, because with it there, this won't match '<body>', but will match '<body >' and '<body one=fish two=fish>'. As some folks mentioned, you need the s before your first delimiter (/) to indicate that you're substituting one thing for another, and the s after your last delimiter to indicate that your match should be viewed as a single-line (and shouldn't stop at a newline). I think some folks responding forgot to remove the \s from within their regexs - or I got the question wrong. The i, of course, indicates case insensitivity. What we end up with is:
-Adam --
In Section
Seekers of Perl Wisdom
|
|