procmail
[Top] [All Lists]

matching a dollar sign

1998-02-18 12:16:12
John Vinopal wrote,

| Certain procmail rules are bizarre.  To match '$', I was forced to use
| \\$ and only through trial and error did I locate that.

Dollar signs are tricky.  Had you had the "$" modifier in place on that
condition, you might have needed yet another backslash or two.  If the
dollar sign weren't the very first character, you'd have needed one fewer.

By Stephen's own recommendation, empty parentheses can sometimes be clearer
than an extra backslash to protect the first character of the regexp from
being interpreted as something else (if it's a dollar sign, an angle bracket,
an exclamation point, or a backslash, for some examples); also, by my own
experimentation, I've found that ($) will match a newline and [$] will match
a literal dollar sign regardless of "$" interpretation.

| The other thing I'm looking for is citations for the scoring rulesets,
| how do I invoke various actions depending on the summation level?  Or am
| I stuck with a not-so-useful true/false invoke/don't invoke setup?

You can always change the threshold by adding or subtracting a constant; just
set x=0 and use a null condition:

   * other conditions
   * 15^0

would add fifteen and make a match if the cumulative score had been anything
greater than -15 otherwise.  Likewise,

  * -20^0

will subtract twenty and cause failure to match if the score would otherwise
have been 20 or less.

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