Another regex question

Giganews Newsgroups
Subject: Another regex question
Posted by:  jwcarlton (jwcarlt…@gmail.com)
Date: Tue, 19 Jul 2011

This is written in Perl, but I don't think that the language would
matter.

Occasionally, posts come through that include something like this:

Normal 0 false false false EN-US X-NONE X-NONE
MicrosoftInternetExplorer4 st1\:*{behavior:url(#ieooui) }

I'm filtering it using this:

$text =~ s/Normal 0 false.*?}//gsi;
$text =~ s/Normal 0.*?MicrosoftInternetExplorer4.*?}//gsi;

This had been working fine, but then today I had 2 posts come through
that had the "Normal..." text (at the very beginning of the post).
What I posted above is a copy and paste of what came through, so it's
verbatim.

By my understanding, the first one should have caught it ("Normal 0
false", followed by any character or lack thereof, until it gets to
the first "}"), but then even if it had failed, the the second one
definitely should have caught it!

Can you guys see any reason why my filters wouldn't have caught this?
I can't imagine that the \:* in the string would have had any impact,
would it?

Replies