procmail
[Top] [All Lists]

catching "$$" and other diseases

2000-05-10 04:50:43
Bill McClatchie asked,

| Suggestions on catching the $$$ type crap welcome.  
| 
| For whatever reason \$\$+ is not working for me.  

1. A leading backslash means "end of stripped whitespace," so the first
   dollar sign is read as representing a newline.  Because the dollar signs
   in the spam are not left-anchored, they don't match.

2. Is \$\$+ the entire expression, or is it part of a longer one that in-
   cludes a variable or a backticked command that you expand with the $
   modifier?  If so, \$ means a newline again.

The way to be positive that your dollar sign represents a literal dollar
sign, regardless of whether there is $ interpretation on the expression,
is to use [$]; the way to be positive that it represents a newline and isn't
taken for a dollar sign or the introduction to a variable is to use ($).

So if you're testing for two adjacent dollar signs,

   :0HB:
   * [$][$]
   mmfspam

or

   :0HB:
   * ()\$\$
   mmfspam

or, counterintuitively,

   :0HB:
   * \\$\$
   mmfspam

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