procmail
[Top] [All Lists]

Re: handling spacing in patterns

1997-08-19 11:15:14
Rik Kabel suggested to an earlier poster whom he did not name (possibly
terry(_at_)teclata(_dot_)es),

| 2) Your recipe does not detect phrases which are split over more than
| one line. The longer the phrase for which you are testing, the more
| likely it is that it will be split (except for mail composed with
| editors which only place newlines at paragraph breaks).  ...

| While procmail will combine multiple lines into one line in headers, ...

To be more specific, procmail will combine the initial line and any
continuation lines of a single header field into one line in searching
the head.

| ... it does not compress white space.

There is an additional reason.

Besides leaving whitespace uncompressed, it also does not look across line
breaks when it is searching the *body*; the regexp must specifically contain
something like ^, $, \<, or \> to match the separating newline if you want
procmail to search across line breaks in the body (or across two or more
header fields).  The original question was about scanning the body, and as
Rik said, the longer the search phrase, the likelier that it will be split.

My personal preference is to use ( |    |$)+ [or sometimes with an asterisk
instead of a plus sign as appropriate] to match runs of whitespace.  There
is a space between the left parenthesis and the first pipe; there is a tab
between the two pipes.

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