shithub: vim

ref: 810e423e40326ed30bb8ce06e86b6b54925e6310
dir: /testdir/test24.in/

View raw version
Tests for regexp with backslash and other special characters inside []
Also test backslash for hex/octal numbered character.

STARTTEST
:set nocompatible viminfo+=nviminfo
/[\x]
x/[\t\]]
x/[]y]
x/[\]]
x/[y^]
x/[$y]
x/[\x61]
x/[\x60-\x64]
xj0/[\x785]
x/[\o143]
x/[\o140-\o144]
x/[\o417]
x/\%x42
x/\%o103
x/[\x00]
x
:s/[\x00-\x10]//g

:s/[\x-z]\+//

:s/[\u-z]\{2,}//

:s/\(a\)\+//

:s/\(a*\)\+//

:s/\(a*\)*//

:s/\(a\)\{2,3}/A/

:s/\(a\)\{-2,3}/A/

:s/\(a\)*\(12\)\@>/A/

:s/\(foo\)\@<!bar/A/

:s/\(an\_s\+\)\@<=file/A/

:s/^\(\h\w*\%(->\|\.\)\=\)\+=/XX/

:s/^\(\h\w*\%(->\|\.\)\=\)\+=/YY/
:?start?,$w! test.out
:qa!
ENDTEST

start
test \text test text
test 	text test text
test text ]test text
test ]text test text
test text te^st text
test te$xt test text
test taext test text  x61
test tbext test text  x60-x64
test 5text test text  x78 5
testc text test text  o143
tesdt text test text  o140-o144
test7 text test text  o41 7
test text tBest text  \%x42
test text teCst text  \%o103
test text test text  [\x00]
test text test text  [\x00-\x10]
test \xyztext test text  [\x-z]
test text tev\uyst text  [\u-z]
xx aaaaa xx a
xx aaaaa xx a
xx aaaaa xx a
xx aaaaa xx
xx aaaaa xx
xx aaa12aa xx
xx foobar xbar xx
xx an file xx
x= 9;
hh= 77;