2008/9/10 Wolfgang N=E1dasi-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=3D/foo|footer/
>> =3D> /foo|footer/
>> irb(main):002:0> r.match('footer').offset(0)
>> =3D> [0, 3]

> Ruby's regular expession engine isn't a posix engine. The same is true fo=
r
> 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

--=20
use.inject do |as, often| as.you_can - without end