procmail
[Top] [All Lists]

Re: escaping special characters (in general)

1995-10-30 09:54:23
From: dattier(_at_)wwa(_dot_)com (David W. Tamkin)
Date: Mon  Oct 30,  9:26am

Try this instead:

 :0:
 * $ ^TO$\foo(_at_)bar\(_dot_)com
 foo

In fact, to avoid matches to things like 
$foo(_at_)bar(_dot_)community(_dot_)edu, you might
want to do it this way:

 :0:
 * $ ^TO$\foo(_at_)bar\(_dot_)com\>
 foo

OK, but this doesn't address my original question: is there a program or
script which, taken a given regular expression, will output a string with
all the regular expression/special characters escaped?  I mean, my procmail
filter is being "built up" by my own sendmail, so that Subject:'s that I send
are given "Priority: A" so it is at the top of my list in mush (Mail User's
SHell).

So, I'm doing "formail -x Subject" and putting:

:0f
*^Subject: (re:)? *the subject
| formail -I "Priority: A"

But, if "the subject" contains any regular expression chars (e.g., "*", "(",
"?", etc.), then I'm screwed.

Do you see my problem?

-- 
Internet: dummy(_at_)emf(_dot_)net                  In real life: Robert Brown,
     >> Television is the opium of the people. <<      in sunny Berkeley, CA
           >> Tony Blaire for president! <<            waiting for The Big One
        ** finger dummy(_at_)emf(_dot_)net for PGP key **         (510) 464-4604