procmail
[Top] [All Lists]

Re: matching words that are laced with html

2003-10-30 09:18:48
On Thu, Oct 30, 2003 at 02:23:40PM +0200, Udi wrote:

----- Original Message ----- 
From: Ian Prideaux 
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE 
Sent: Thursday, October 30, 2003 11:27 AM
Subject: Re: matching words that are laced with html


Shea Gray wrote:
I wanted to find out how you guys go about matching words that have html
comments in them like the one below....

Viag<!-- necessity -->ra

Im not sure how I should go about writing the regexp for this, so some
of your examples or suggestions would be nice. Thanks in advance.

I guess that it would be something like:

V<!--.*-->i<!--.*-->a<!--.*-->g<!--.*-->r<!--.*-->a

    ".*"  will eat the whole string.  Use  [^-]*

Udi, ".*" is stingy. It won't eat the whole string unless it's on the
right of the \/ operator. Further, it is legal HTML to put a hyphen
between comments: <!-- this - is - a - comment -->, so the character
class probably wouldn't work all the time.

Scott
-- 
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail