blob: 455c3e3045ac0d77feb683c3811e5f013a0852fd [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/ち\<カヨ\>は
Bram Moolenaarc0197e22004-09-13 20:26:32 +000024x:" Test \%u, [\u] and friends
25/\%u20ac
26x/[\u4f7f\u5929]\+
27x/\%U12345678
28x/[\U1234abcd\u1234\uabcd]
29x/\%d21879b
Bram Moolenaar071d4272004-06-13 20:20:40 +000030x:?^1?,$w! test.out
Bram Moolenaar89cb5e02004-07-19 20:55:54 +000031:e! test.out
32G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב
33:put =matchstr(\"אבגד\", \"..\", 0, 2) " בג
34:put =matchstr(\"אבגד\", \".\", 0, 0) " א
35:put =matchstr(\"אבגד\", \".\", 4, -1) " ג
36:w!
Bram Moolenaar071d4272004-06-13 20:20:40 +000037:qa!
38ENDTEST
39
401 a aa abb abbccc
412 d dd dee deefff
423 g gg ghh ghhiii
434 j jj jkk jkklll
445 m mm mnn mnnooo
456 x ^aa$ x
467 (a)(b) abbaa
478 axx [ab]xx
489 หม่x อมx
49a อมx หม่x
50b ちカヨは
Bram Moolenaarc0197e22004-09-13 20:26:32 +000051c x ¬€x
52d 天使x
53e ü’…™¸y
54f ü’Š¯z
55g a啷bb