Re: [EXIM] filter problem

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Steven A. Reisman
CC: Ben Smithurst, exim-users
Sujet: Re: [EXIM] filter problem
On Sun, 14 Jun 1998, Steven A. Reisman wrote:

> Well, severe frustration set in, and I tried increasing numbers of
> backslashes until it worked. The magic number is 6:
>
>    if $h_subject matches "\\\\\\$\\\\\\$\\\\\\$"


(1) Because you have put the string in double quotes, \ is interpreted
as an escape when the quoted string is first read in. So the equivalent
is

    if $h_subject matches \\\$\\\$\\\$


If you can avoid double quotes in these cases, it helps a bit. :-)

(2) Because each string in a "matches" condition is subject to string
expansion, \ is interpreted as an escape character during expansion. So
after expansion we have

    if some-string matches \$\$\$


(3) Then, at last, the regex matching happens, with \ being taken as an
escape for the third time to ensure that the $s are treated as literals.

I will add a few more words to section 19 of the filter document to try
to make it easier to figure out how many backslashes you need, and give
the example of \$.

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



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