Re: [exim] Trouble with a match condition

Etusivu
Poista viesti
Vastaa
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: Hill Ruyter
Kopio: exim-users
Aihe: Re: [exim] Trouble with a match condition
On Sat, 7 Oct 2006, Hill Ruyter wrote:

> It would be really nice if there was a simplified explanation with some
> common examples (and mistakes) for the use of regular expressions within the
> exim documentation rather than just a link to the PCRE docs.
> Or perhaps there is and I was too dumb to spot it ?


It would be nice, but it really is up to somebody who is keen to collect
them and put them on the wiki. I haven't checked - there may be
something there already. (There aren't enough hours in my day.)

The distributed spec is a *reference* manual, as it states. It isn't
intended as a repository for examples, though a quick grep of spec.txt
shows these three examples of ${if {match:

  { match{$h_precedence:}{(?i)bulk|list|junk} }\
  { match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }\
  ${if match{$local_part}{[A-Z]}{1}{0}}\    


Apart from the lack of delimiters, the regexes are pretty well exactly
as in Perl, so many Perl examples are relevant. There is also much
excellent and informative discussion in Jeffrey Friedl's book "Mastering
Regular Expressions". So I must say that I'm not entirely convinced of
the need for a whole slew of Exim-specific examples.

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book