blob: 2748e3d01539d15fe53dd957ba09b9fc7bf6b2ed [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001Tests for regexp with multi-byte encoding and various magic settings.
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00002Test matchstr() with a count and multi-byte chars.
Bram Moolenaar071d4272004-06-13 20:20:40 +00003
4STARTTEST
5:so mbyte.vim
6:set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo
7/^1
8/a*b\{2}c\+/e
9x/\Md\*e\{2}f\+/e
10x:set nomagic
11/g\*h\{2}i\+/e
12x/\mj*k\{2}l\+/e
13x/\vm*n{2}o+/e
14x/\V^aa$
15x:set magic
16/\v(a)(b)\2\1\1/e
17x/\V[ab]\(\[xy]\)\1
18x:" Now search for multi-byte without composing char
19/ม
20x:" Now search for multi-byte with composing char
21/ม่
22x:" find word by change of word class
23/ち\<カヨ\>は
24x:?^1?,$w! test.out
Bram Moolenaar89cb5e02004-07-19 20:55:54 +000025:e! test.out
26G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב
27:put =matchstr(\"אבגד\", \"..\", 0, 2) " בג
28:put =matchstr(\"אבגד\", \".\", 0, 0) " א
29:put =matchstr(\"אבגד\", \".\", 4, -1) " ג
30:w!
Bram Moolenaar071d4272004-06-13 20:20:40 +000031:qa!
32ENDTEST
33
341 a aa abb abbccc
352 d dd dee deefff
363 g gg ghh ghhiii
374 j jj jkk jkklll
385 m mm mnn mnnooo
396 x ^aa$ x
407 (a)(b) abbaa
418 axx [ab]xx
429 หม่x อมx
43a อมx หม่x
44b ちカヨは