procmail
[Top] [All Lists]

Re: regular expressions: question(s)

1997-06-06 03:49:00
"Luke" == Luke Davis <ldavis(_at_)voicenet(_dot_)com> writes:

Luke> * Does anyone know of a document, available on the net,
Luke> describing/presenting data about the use of regular expressions
Luke> as used in procmail, sed, etc.?

man 5 procmailrc
man sed (or vi, or even ed)
man 7 regex (not so sure about this one)

Luke> * I want to check the From:, and Reply-to: fields, for either
Luke> the contents of the var abc, or the var def... Will this do it?:

Luke> * $^(From:|Reply-to:).*(${abc}|${def})

Yes, it will work.

Luke> * I want to check the subject for the words "get file ",
Luke> followed by "pw=", and the contents of the "pw" var, then
Luke> nothing else but space/tabs... Will either of the following
Luke> work?:

Luke> * $^Subject:[     ]get file pw=${pw}[     ]*>

Replace the last > by \$, and it will work. You are better at regular
expressions than you think.

-- 
Guy Geens <ggeens(_at_)iname(_dot_)com>
Home Page: http://www.elis.rug.ac.be/~ggeens
finger ggeens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be for PGP public keys (or use 
keyserver) 
"Now excuse me, I have some Daemons to fight"   -- Firkin

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