Jari Aalto was wondering about these:
| WSPACE = " \n" # whitespace = space, tab newline
No, just as procmail doesn't grok \t, it doesn't know from \n either.
To save a space, a tab, and a newline in a variable, you need to do this:
This might be easier to read, though:
| *$ variable ?? [$WSPACE]
No good. A bracketed range, whether negated or not, will *never* match a
A variable to save an expression that will match a space, a tab, or a newline
is this (to use your suggested variable names):
WSPC="( | |$)"
To match a space or a tab, don't bother doing this:
but rather this:
because if you leave the brackets out, you can negate it:
matches a space or tab.
matches anything except a space, a tab, or a newline.
matches anything except a space or a tab, even a newline.
| Or should it say this sto get the correct effect?
| *$ variable ?? [^$\WSPACE]
Don't use $\ inside brackets because the leading () generated by $\ will
trip you up.
| What if I want literal $ inside bracket?
A $ inside brackets, unless it begins a variable name and the "$" modifier
is on, *always* means a literal dollar sign. It cannot mean a newline if
it appears inside brackets. A good way to keep it exempt from "$" inter-
pretation is to put it last inside the brackets (unless you also need to
include a literal hyphen and you can't put the hyphen first; then you'll need
to escape the dollar sign with a backslash and put the hyphen last -- well,
you could alternatively escape the hyphen, I guess), because procmail knows
that "$]" cannot possibly be a reference to a variable.
($) always matches a newline, with or without "$" interpretation;
[$] always matches a dollar sign, with or without "$" interpretation;
| Is the WSPC correct abbreviation for whitespace?
It will be if that's what you decide on.