Hello Vim developers,

there's another discrepancy between the regular expression engines:

for n in [0, 1] | echo string(matchstr(' x', '\%#=' . n . '^\s\{-}\zs\(x\| 
x$\)')) | endfor
for n in [0, 1] | echo string(matchstr(' x', '\%#=' . n . '^\s\{-}\ze\(x\| 
x$\)')) | endfor
for n in [0, 1] | echo string(substitute(' x', '\%#=' . n . '^\(\s\{-}\)\(x\| 
x$\)', '\1|\2', '')) | endfor

It apparently depends on the non-greedy \s\{-} match together with the
branches where only one is anchored. It does _not_ matter whether the
split is introduced with \zs, \ze, or capturing groups.

To reproduce, use above scriptlet or the identical attached script:

vim -N -u NONE -S bad-re3.vim
'x'
' x'
' '
''
' |x'
'| x'

This is with a huge build of Vim 7.4.110, running in an Ubuntu 13.04 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/groups/opt_out.

Attachment: bad-re3.vim
Description: application/octetstream

Raspunde prin e-mail lui