procmail
[Top] [All Lists]

Re: Regex trouble:

1998-02-11 01:45:23
era eriksson <era(_at_)iki(_dot_)fi> writes:
On Mon, 9 Feb 1998 17:40:28 -0700 (MST), Sherwood Botsford
<sherwood(_at_)math(_dot_)ualberta(_dot_)ca> wrote:
...
* +200^1 \!\!\!\!

(You don't need to backslash-escape shouts in any regex implementation
I know of. The backslash is harmless here, although you should be
aware that a leading backslash will often lead to problems in
Procmail.)

Actually, you do need the first backslash, to keep procmail from
considering the backslash as a request to invert the sense of the match.
For example, these two conditions are equivalent:

        * ! 200^1 foo
        * 200^1 !foo

Therefore, a leading '!' must either be backslashed, enclosed in either
parens or brackets (I suspect that parens would be more efficient), or
prefaced with an empty pair of parens.  I would recommend writing the
condition as:

        * 200^1 ()!!!!
or
        * 200^1 (!!!!)


Philip Guenther

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