On Fri, 24 Jun 2005, Jakob Hirsch wrote:
> Philip Hazel wrote:
>
> > ^(?>.*)(?<=abc|defg|hijkl|...)
>
> errr... have to look up what this in detail means.
Yes, I didn't want to do it *all* for you. <grin>
But I'll explain it if you like. Just ask...
> > is the fastest way to match "ends with abc or defg or hijkl or..." because
> > there is no backtracking. The only restriction is that each alternative must
> > be of a fixed length.
>
> so your example is not valid? (length(abc) != length(defg))
In Perl, it is not valid because each branch does indeed have to be of
the same fixed length. In the PCRE library that Exim uses, the
only restriction is that each branch be a fixed length. They do not all
have to be the same fixed length. What I wrote is valid in PCRE and
Exim. However, something like
^(?>.*)(?<=ab{2,3}c|d*efg|hi?jkl)
would be invalid (none of the branches is a fixed length).
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book: http://www.uit.co.uk/exim-book