Robert Klemme schrieb:
> 2008/9/10 Wolfgang N?dasi-Donner <ed.odanow / wonado.de>:
>> Wim Yedema schrieb:
> 
>>> Regexp does not match the longest string, as do regular expression for
>>> Linux (or posix).
>>> For example:
>>>
>>> irb(main):001:0> r=/foo|footer/
>>> => /foo|footer/
>>> irb(main):002:0> r.match('footer').offset(0)
>>> => [0, 3]
> 
>> Ruby's regular expession engine isn't a posix engine. The same is true for
>> Perl an several other programming languages.
> 
> I'd say this is not about POSIX or not. Rather, the reason for the
> observed behavior is the fact that this RX engine is a NFA as opposed
> to some others which are DFAs.
> 
> Cheers
> 
> robert
> 
There are interpreted NFAs, which match all alternatives and select the 
longest match afterwards. As I understood the "posix"-story, and as it 
is described in the "Friedl", this is the expection of Wim.

Wolfgang