Re: [exim] Regex documentation question

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Neil Youngman
Date:  
À: exim-users
CC: jh
Sujet: Re: [exim] Regex documentation question
Jakob Hirsch [mailto:jh@plonk.de] wrote

> Quoting Neil Youngman:


> > When trying to decide whether a match was case sensitive or not, all
> > I could find in the documentation was "the PCRE_CASELESS option is
> > set when the matching is required to be case-insensitive." It seems
> > that PCRE_CASELESS is set for this condition


> > condition=${if or {{match{$header_subject:}{Out of Office Autoreply}}
> > {match{$header_subject:}{Auto Reply Message}}} {true}{false} }


> Are you sure? I didn't test, but I'd think that caseless matching
> is only done for domain and local_part.


In our tests it matched on
Subject: ab auto reply message yz
which I didn't expect

> > I can't tell from the documentation whether PCRE_CASELESS should be
> > set for match conditions and i had to determine that experimentally.


> The spec says that PCRE's default options are used, which means none are
> set (except for the cases above). If you want to set it explicitely, you
> can use (?i) or (?-i) at the beginning of the pattern. As the spec says,
> this is described in doc/pcrepattern.txt.


The spec says "the PCRE_CASELESS option is set when the matching is required to be case-insensitive". I did not expect that to apply here, and neither did you, but my tests seem to show a caseless match.

> > Also, it would be nice if chapter 8 referred us to 'man pcre' instead
> > of just a book for the pcre syntax. It seems obvious, but i didn't


> This would be the man page of the system's pcre installation, which is
> not necessarily the same as the one Exim uses.


True. I missed the reference to doc/pcrepattern.txt, which is more useful.

Neil Youngman