Procmail implements a form of regular expressions that operates slightly differently than other UNIX utilities. Here we cover the basic differences and guide the new user into the powerful world of regular expressions, their meanings, implementations, and uses.
We have already seen that Procmail matches are case insensitive unless the D
flag is used. This is also true for regular expressions. Procmail also uses multiline matches by default.
New users to the world of Linux and programming in general, may not be aware of the powerful features that regular expressions bring to processing data. In its simplest form, regular expressions can be understood as searching for a phrase or pattern anywhere in a body of data. The following simple example shows how we can match all mail items where the header and/or body contains the phrase mystical monsters
and place the mail in a relevant folder.
:0 HB: * mystical monsters ${MAILDIR}/monsters/
However...