procmail
[Top] [All Lists]

Re: Match operator and massive regex

2001-12-09 23:42:20
Harry Putnam <reader(_at_)newsguy(_dot_)com> writes:
Martin McCarthy <marty(_at_)ancient-scotland(_dot_)co(_dot_)uk> writes:
...
The extra '(.*,)?' will permit the condition to skip over any
non-matching newsgroups on the Newsgroups line, but will stop at the
first matching one it finds.  Does that make sense to you?

Yes.  But it would be nice if this kind of discussion were in the
procmail man pages.  Maybe it is and I'm missing it.  I don't expect
the kind of details like in this thread but for example:
The fact that perl-like non-greedy operators work.

Those aren't non-greedy operators.  "(.*,)?" means "optionally match
any number of non-newline characters followed by a comma".  Non-greedy
operators have the question mark right after the *, +, ?, or }.  Procmail
does not support non-greedy operators as such.  When using the match
token, procmail treats _all_ the operators on the left-hand side of the
\/ as non-greedy and all the operators on the right-hand side of the \/
as greedy.  Yes, this is screwy, but it's the way it is.

You may want to pick up the O'Reilly "Master Regular Expressions" book,
written by Jeffery Friedl.  While my copy isn't well-thumbed, that's
only because I haven't had it long enough...


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

<Prev in Thread] Current Thread [Next in Thread>