Lines Matching refs:submatch

339 " Test for submatch() on substitute().
344 \ '\=substitute(submatch(0), ".", "\\", "")', ''))
346 \ '\=substitute(submatch(0), ".", "\\\\", "")', ''))
347 …call assert_equal("c\<C-V>\<C-M>c", substitute('cCc', 'C', '\=substitute(submatch(0), ".", "\<C-V>…
348 …call assert_equal("d\<C-V>\<C-M>d", substitute('dDd', 'D', '\=substitute(submatch(0), ".", "\\\<C-…
349 …call assert_equal("e\\\<C-V>\<C-M>e", substitute('eEe', 'E', '\=substitute(submatch(0), ".", "\\\\…
350 …call assert_equal("f\<C-M>f", substitute('fFf', 'F', '\=substitute(submatch(0), ".", "\\r", "")', …
351 call assert_equal("j\nj", substitute('jJj', 'J', '\=substitute(submatch(0), ".", "\\n", "")', ''))
352 call assert_equal("k\rk", substitute('kKk', 'K', '\=substitute(submatch(0), ".", "\r", "")', ''))
353 call assert_equal("l\nl", substitute('lLl', 'L', '\=substitute(submatch(0), ".", "\n", "")', ''))
361 \ '\=submatch(0) . submatch(9) . submatch(8) . ' .
362 \ 'submatch(7) . submatch(6) . submatch(5) . ' .
363 \ 'submatch(4) . submatch(3) . submatch(2) . submatch(1)',
369 \ '\=string([submatch(0, 1), submatch(9, 1), ' .
370 \ 'submatch(8, 1), 7->submatch(1), submatch(6, 1), ' .
371 \ 'submatch(5, 1), submatch(4, 1), submatch(3, 1), ' .
372 \ 'submatch(2, 1), submatch(1, 1)])',
389 call assert_equal('AA', substitute('AA', 'A.', '\=submatch(0)', ''))
390 call assert_equal("B\nB", substitute("B\nB", 'B.', '\=submatch(0)', ''))
391 call assert_equal("['B\n']B", substitute("B\nB", 'B.', '\=string(submatch(0, 1))', ''))
564 " Test for submatch() on :substitute.
570 let tests = [ ['aAa', "s/A/\\=substitute(submatch(0), '.', '\\', '')/",
572 \ ['bBb', "s/B/\\=substitute(submatch(0), '.', '\\', '')/",
574 \ ['cCc', "s/C/\\=substitute(submatch(0), '.', '\<C-V>\<C-M>', '')/",
576 \ ['dDd', "s/D/\\=substitute(submatch(0), '.', '\\\<C-V>\<C-M>', '')/",
578 \ ['eEe', "s/E/\\=substitute(submatch(0), '.', '\\\\\<C-V>\<C-M>', '')/",
580 \ ['fFf', "s/F/\\=substitute(submatch(0), '.', '\\r', '')/",
582 \ ['gGg', 's/G/\=substitute(submatch(0), ".", "\<C-V>\<C-J>", "")/',
584 \ ['hHh', 's/H/\=substitute(submatch(0), ".", "\\\<C-V>\<C-J>", "")/',
586 \ ['iIi', 's/I/\=substitute(submatch(0), ".", "\\\\\<C-V>\<C-J>", "")/',
588 \ ['jJj', "s/J/\\=substitute(submatch(0), '.', '\\n', '')/",
590 \ ['kKk', "s/K/\\=substitute(submatch(0), '.', '\\r', '')/",
592 \ ['lLl', "s/L/\\=substitute(submatch(0), '.', '\\n', '')/",
603 …)\(.\)/\=submatch(0) . submatch(9) . submatch(8) . submatch(7) . submatch(6) . submatch(5) . subma…
604submatch(0, 1), submatch(9, 1), submatch(8, 1), submatch(7, 1), submatch(6, 1), submatch(5, 1), su…
635 let tests = [ ["A\<C-V>\<C-M>A", 's/A./\=submatch(0)/', ['A', 'A']],
636 \ ["B\<C-V>\<C-J>B", 's/B./\=submatch(0)/', ['B', 'B']],
637 \ ["C\<C-V>\<C-J>C", 's/C./\=strtrans(string(submatch(0, 1)))/', [strtrans("['C\<C-J>']C")]],
638 …\ ["D\<C-V>\<C-J>\nD", 's/D.\nD/\=strtrans(string(submatch(0, 1)))/', [strtrans("['D\<C-J>', 'D']"…
639 …-V>\<C-J>\n\<C-V>\<C-J>\n\<C-V>\<C-J>E", 's/E\_.\{-}E/\=strtrans(string(submatch(0, 1)))/', [strtr…
644 call assert_fails('s/Q[^\n]Q/\=submatch(0)."foobar"/', 'E486:')
676 return submatch(0)
866 \ '\=nr2char("0x" . submatch(1))', 'g'))
868 \ {-> nr2char("0x" . submatch(1))}, 'g'))
871 \ {-> submatch(2) . submatch(3) . submatch(1)}, ''))
874 return substitute('yyy', 'y\(.\)y', {-> submatch(1)}, '')
877 …call assert_equal('-y-x-', substitute('xxx', 'x\(.\)x', {-> '-' . Recurse() . '-' . submatch(1) . …
879 call assert_fails("let s=submatch([])", 'E745:')
880 call assert_fails("let s=submatch(2, [])", 'E745:')
885 call assert_fails("call substitute('x', '.', {-> submatch(10)}, '')", 'E935:')
886 call assert_fails('eval submatch(-1)', 'E935:')
887 call assert_equal('', submatch(0))
888 call assert_equal('', submatch(1))
889 call assert_equal([], submatch(0, 1))
890 call assert_equal([], submatch(1, 1))
895 let Rep = {-> string([submatch(0, 1)] + [[submatch(1)]])}
928 " Test for using submatch() with a multiline match
932 %s/^line1\(\_.\+\)line4$/\=submatch(1)/