procmail
[Top] [All Lists]

Re: (il)logical algebra

2004-03-25 08:59:47
On Thu, 25 Mar 2004, Robert Allerstorfer wrote:

On Thu, 25 Mar 2004, 09:50 GMT-01 Klaus Johannes Rusch wrote:

Regular expressions generally define matching patterns and have no
concept of negation

this is not a general rule for regexes. Perl's regex machine knows
constructs that match the presence and the absence of a pattern, in
both directions. They are known as positive look-aheads, negative
look-aheads, positive look-behinds and negative look-behinds.

Perl's negative look-aheads and look-behinds are not equivalent to negated
regular expressions.  Among other restrictions documented in the "perlre"
manual, look-ahead/behind must be fixed-length subpatterns (no "?", "+",
"*", or "{,}" operators).  And even if they were fully general patterns,
the statement "true for a string that matches foo without bar" is not
equivalent to "true for a string that does not match bar".


_______________________________________________
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>