Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Aaaagh! Simple RegExp Help Needed
May 25, 2005, 12:46 pm
rate this thread
I write fairly complex regexps on a daily basis (complex to me anyway)
but I didn't get much sleep last night and I think that's why this one
is doing my nut. I can't for the life of me work out why:
my $test = "Lalalala <head>this is the \nhead zone\n\n<other
tag></other tag>\n\n<!--lalalala-->\n</head> totototot";
$test =~ s/<head>.*<\/head>//;
Doesn't strip out everything between and including the
<head>....</head> HTML tags.
I know it's not the most robust regexp. It's a simplified form of what
I actually want, but it best illustrates my point.
I'm missing something obvious I know... but what?