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.
-- regards, ingo
--
--
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.
bad-re5.vim
Description: application/octetstream
