Re: [EXIM] Filtering

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Philip Hazel
Data:  
Para: Max Caines
CC: exim-users
Assunto: Re: [EXIM] Filtering
On Fri, 7 Nov 1997, Max Caines wrote:

> I am trying to construct a system filter expression to match a value in
> dollars, to look like this:
>
>     if $h_Subject: matches "\\$[0-9]+"

>
> I have tried it with numbers of backslashes before the '$' ranging from
> zero to 4, and (in desperation) making it a character class (e.g.
> "[\\$][0-9]+"). Either it won't parse; or it does, but doesn't match a
> header like 'Make $150 now'. I can't work out from the documentation what
> the expression _should_ look like. Can anyone tell me?


The problems of multi-level escaping....

The regular expression you want is:     


\$[0-9]+

Because its in an expanded string, you have to escape both \ and $. Thus
you get

\\\$[0-9]+

But you have also enclosed it in double quotes, in which \ is also
recognized as an escape character, so you have to put

"\\\\\\$[0-9]+"

Personally, I'd leave off the double quotes. It's bad enough as it is...


-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



--
*** Exim information can be found at http://www.exim.org/ ***