Autor: Jakob Hirsch Data: A: Neil Youngman CC: exim-users@exim.org Assumpte: Re: [exim] Regex documentation question
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.
$ exim -be > ${if match{out of office autoreply}{Out of Office Autoreply} {matching}{no match} }
no match
but:
> ${if match{out of office autoreply}{(?i)Out of Office Autoreply} {matching}{no match} }
matching
> 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.
> 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.