[Top] [All Lists]

Re: bug in \< handling?

1996-06-21 07:34:36
Michael Tiemann <tiemann(_at_)cygnus(_dot_)com> writes:
Given identical input, these two rules score the input differently:

procmail: Score:       8      -1 "[^a-zA-Z0-9_](job|resume|employment|referenc

procmail: Score:       0      -9 "\<(job|resume|employment|references|educatio

according to procmailrc, \< is shorthand for [^a-zA-Z0-9_], so I think
this is a bug.  The input is below:

After some testing I suspect the problem you're experiancing is caused
by the following undocumented, but understandable, wart:

        a leading backslash in a condition has to be doubled

A recipe that begins:

* <foo

looks to procmail like a '<' size condition.  That means that if you want
to match a literal '<' at the beginning of the line, you have to escape it:

# Match literal "<foo"
* \<foo

So if you want the regexp to start with "\<" then you have to double the

# Match regexp "\<foo"
* \\<foo

However, less confusing alternative exists:

# Match regexp "\<foo"
* (\<foo)

# Match literal "<foo"
* (<foo)

Philip Guenther

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