procmail
[Top] [All Lists]

Re: Regex trouble:

1998-02-11 01:54:00
Era Eriksson suggested to Sherwood Botsford,

| Your problem is
| not with that, though: the problem is the dreaded leading backslash
| problem.
| 
|  > * +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.)

The second, third, and fourth backslashes are harmless there, but the first
one is better than harmless: it is vital!  Otherwise a bare leading exclama-
tion point will be taken for a negation.

Actually, if there were no backslashes at all, procmail would take the
condition to mean not-not-not-not null, and all mail would score supremum.

A regexp of four adjacent exclamation points is best written

       \!!!!
or
       ()!!!!

|  > * +200^1 \$\$\$
| 
| Change this to * +200^1 [$][$][$] and you're fine.

or  \\$\$\$ or ()\$\$\$, but dollar signs are a peculiar problem, so Era's
suggestion is best.

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