From: Phrogz Date: 2007-12-14T04:05:01+09:00 Subject: Re: Regexp Matching Not Blank And Not A Specific Word? On Dec 13, 11:47 am, Sebastian Hungerecker wrote: > Andrew Stewart wrote: > > In fact I'm beginning to doubt > > that (?!re) works at all on my system (Ruby 1.8.6)...but on balance > > it's probably me rather than my Ruby installation! > > It's not you. The ruby 1.8 regexen don't support negative lookahead. You'll > get that in ruby 1.9 or by installing and using the oniguruma regexp-engine > instead of the default ruby 1.8 one. Not true: C:\>ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\>irb irb(main):001:0> s = "hello world" => "hello world" irb(main):002:0> s.scan /[eo]./ => ["el", "o ", "or"] irb(main):003:0> s.scan /[eo](?!r)./ => ["el", "o "] It just doesn't support negative or positive *lookbehinds*.