Re: [exim] pcre matching

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Marc Sherman
Datum:  
To: exim-users
Betreff: Re: [exim] pcre matching
David Saez Padros wrote:
>
> I'm trying to get some Perl regexp stollen elsewhere to work in exim
> but have some problems and my knowledge of pcre is very limited.
> It looks like exim does not like expression surrounded by /
> like /[a-z]/ or /\@china\.com/i , should i remove the surrounding
> / or there is a way to get it working ? in fact they work with
> pcretest but not in exim ...


Exim expansion conditions use {} to delimit regexes (like all strings),
instead of //.

> [debian exim]# /usr/local/exim/bin/exim -be
> > ${if match {david@???}{/[a-z]/}{1}{0}}
> 0


${if match {david@???}{[a-z]}{1}{0}}

You may need to wrap the regex in \N to disable escaping within the
regex. See chapter 11 for more details.

- Marc