Search code examples
regexlinuxunixprocmail

How to match any whitespace in body of mail in procmail?


I tried to use such rule:

:0 B
* Something[[:space:]]+whatever

but it doesn't work.

When I change [[:space:]] to literal space character:

:0 B
* Something +whatever

it works.

It also works in case of:

:0 B
* Something[ ]+whatever

I must be doing something wrong, but can't really find it. Any hints?


Solution

  • What about just adding the white space characters in a class you want to match:

    [ \t\r\n]
    

    matches a space, tab, carriage return and line feed.

    There are of course more white space chars, but these are the most commonly used.