On 23 Mar 2000, at 16:27, Philip Hazel wrote:
> On Thu, 23 Mar 2000, Kai Henningsen wrote:
>
> > ... have a look at this:
> > $ perl -e '$x = "bla-blubb.nix"; $x =~ /(\..*|-.*)$/; print "matched
> > <$&>\n";'
> > matched <-blubb.nix>
> > $
> >
> > This does _not_ match the first; it does match the longest.
>
> Oooh, you are getting into the really complicated depths of regexes
> here! When a regex is not anchored things can get messy.
>
> Actually, it isn't the longest (though it happens to be). It is the
> first that it actually finds. It tries the alternative \.. on the letter
> "b", fails to match, so tries the next alternative -.* and fails on that
> too. So the starting point is moved on one character to the letter "l"
> and it tries again. You will see that the first thing that does match is
> when it gets to the hyphen character - the rest of the regex then
> matches.
Well, so it does match the longest for cases that correspond to
Exim's suffix handling, but maybe not in other cases :-)
> Maybe I shouldn't have started this regex talk...
Well, maybe ;-)
> > > Return-path: <ph10@???>
> > > Envelope-to: kai.henningsen-carmen@???
> >
> > (Incidentally, why does one use <> and not the other?)
>
> Because the first can be <>
Ok, so why then does the second not use the same syntax?
Regards - Kai Henningsen
--
http://www.cats.ms
Spuentrup CTI Fon: +49 700 CALL CATS (=22 55 22 87)
Windbreede 12 Fax: +49 251 322312 99
D-48157 Muenster Mob: +49 161 322312 1
Germany GSM: +49 171 7755060