procmail
[Top] [All Lists]

regexp doesn't match longest possible substring

1996-08-07 09:00:40
The procmail internal egrep does not match the longest possible
substring (left precedence).  Is the behavior of the pattern matcher
specified, so it is always possible to determine what MATCH will be?

If the behavior is unspecified, this is a problem when using \/ to
fill MATCH.  In other regexp programs one can use parens to group and
numbered variables to extract specific groups.

Here's a simple example:
----------------------------------------
# The " *" in the subject regexp match does not match the
# longest possible regexp.  Send email with a subject line 
# "foo          bar".  The " *" does not absorb all spaces 
# after "foo", which leaves those spaces in MATCH.

:0h
* $ ^Subject: foo *\/.*
|echo "match is \"$MATCH\"" >> bug.log
----------------------------------------

Mike

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