0
0
mirror of https://github.com/vim/vim.git synced 2025-11-13 22:54:27 -05:00

updated for version 7.3.1243

Problem:    New regexp engine: back references in look-behind match don't
            work. (Lech Lorens)
Solution:   Copy the submatches before a recursive match.
This commit is contained in:
Bram Moolenaar
2013-06-26 12:42:44 +02:00
parent daa270289b
commit f86c0b01a7
4 changed files with 24 additions and 4 deletions

View File

@@ -380,6 +380,9 @@ STARTTEST
:call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i'])
:call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', ''])
:call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a'])
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.com', 'foo.bat/foo.com', 'bat'])
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat'])
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
:"
:"""" Look-behind with limit
:call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])

View File

@@ -866,6 +866,15 @@ OK 2 - \(\d*\)a \1b
OK 0 - ^.\(.\).\_..\1.
OK 1 - ^.\(.\).\_..\1.
OK 2 - ^.\(.\).\_..\1.
OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
OK 0 - <\@<=span.
OK 1 - <\@<=span.
OK 2 - <\@<=span.