procmail
[Top] [All Lists]

Re: 3.11pre4 regexp bug?

1999-06-03 18:09:44
Rik Kabel <rik(_at_)netcom(_dot_)com> writes:
I am puzzled. The following conditions, which I thought were
equivalent, give different results. Here is the test harness and
output. The input file contains a header line with a single
space in it.

No, it contains a header that is continued onto the next line, albeit
with no actual data on the second line.  As far as procmail's regexp
engine is concerned, that space is the last character of the
Content-Type: header field's value.

...
:0
* ^[   ]+$
{ LOG='Hit with ^$'"$CRLF" }
:0
* ^[   ]+^
{ LOG='Hit with ^^'"$CRLF" }
:0
* $[   ]+^
{ LOG='Hit with $^'"$CRLF" }
:0
* $[   ]+$
{ LOG='Hit with $$'"$CRLF" }

Leading dollarsigns cause procmail to perform variable and command
expansion on a condition, so those last two conditions end up being
interpreted as the regexps "[   ]+^" and "[     ]+$", respectively.


Philip Guenther

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