2011/11/10 Suraj Kurapati <sunaku / gmail.com>:
>
> My current approach is to expand (?v:STUFF) into (?:(?!STUFF).) when the regexp AST is built.

Unfortunately, it doesn't work well.

% ./ruby -e 'p /\A(?v:foo)o\z/ =~ "foo"'
nil

/(?v:foo)/ matches "fo" because "fo" is not "foo" and
"fo" doesn't include "foo".
(So, negation / non-inclusion doesn't differ in this case.)

And /o/ matches "o".

So, /(?v:foo)o/ should match "foo" but the implementation doesn't.
-- 
Tanaka Akira