Ingo Karkat wrote:

> Hello Vim developers,
> 
> there's yet another discrepancy between the regular expression engines:
> 
> for n in [1,2] | echo match('",abc" in "abc,abc"', '\%#=' . n .
> '\1\@<=,\([a-z]\+\)') | endfor
> 
> I actually found this while checking out an example from the help
> (trying to understand why a regexp I use in a plugin didn't work):
> 
> ,----[ :help /\@<= ]----
> | The part of the pattern after "\@<=" and "\@<!" are checked for a
> | match first, thus things like "\1" don't work to reference \(\) inside
> | the preceding atom.  It does work the other way around:
> | Example                     matches ~
> | \1\@<=,\([a-z]\+\)  ",abc" in "abc,abc"
> `----
> 
> The NFA engine somehow doesn't properly handle the backreference
> assertion and finds a match where it shouldn't.
> 
> To reproduce, use above scriptlet or the identical attached script:
> 
> vim -N -u NONE -S bad-re5.vim
> 14
> 1
> 
> This is with a huge build of Vim 7.4.383, running in an Ubuntu 13.10 x64
> VM.

Thanks, I'll add it to the todo list.

Keep in mind that NFA does not actually support backreferences, that it
works at all in Vim is a bit of a miracle :-).

-- 
ARTHUR:       Now stand aside worthy adversary.
BLACK KNIGHT: (Glancing at his shoulder) 'Tis but a scratch.
ARTHUR:       A scratch?  Your arm's off.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui