Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | Tests for regexp with multi-byte encoding and various magic settings. |
Bram Moolenaar | 89cb5e0 | 2004-07-19 20:55:54 +0000 | [diff] [blame] | 2 | Test matchstr() with a count and multi-byte chars. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3 | |
| 4 | STARTTEST |
| 5 | :so mbyte.vim |
| 6 | :set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo |
| 7 | /^1 |
| 8 | /a*b\{2}c\+/e |
| 9 | x/\Md\*e\{2}f\+/e |
| 10 | x:set nomagic |
| 11 | /g\*h\{2}i\+/e |
| 12 | x/\mj*k\{2}l\+/e |
| 13 | x/\vm*n{2}o+/e |
| 14 | x/\V^aa$ |
| 15 | x:set magic |
| 16 | /\v(a)(b)\2\1\1/e |
| 17 | x/\V[ab]\(\[xy]\)\1 |
| 18 | x:" Now search for multi-byte without composing char |
| 19 | /ม |
| 20 | x:" Now search for multi-byte with composing char |
| 21 | /ม่ |
| 22 | x:" find word by change of word class |
| 23 | /ち\<カヨ\>は |
| 24 | x:?^1?,$w! test.out |
Bram Moolenaar | 89cb5e0 | 2004-07-19 20:55:54 +0000 | [diff] [blame] | 25 | :e! test.out |
| 26 | G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב |
| 27 | :put =matchstr(\"אבגד\", \"..\", 0, 2) " בג |
| 28 | :put =matchstr(\"אבגד\", \".\", 0, 0) " א |
| 29 | :put =matchstr(\"אבגד\", \".\", 4, -1) " ג |
| 30 | :w! |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 31 | :qa! |
| 32 | ENDTEST |
| 33 | |
| 34 | 1 a aa abb abbccc |
| 35 | 2 d dd dee deefff |
| 36 | 3 g gg ghh ghhiii |
| 37 | 4 j jj jkk jkklll |
| 38 | 5 m mm mnn mnnooo |
| 39 | 6 x ^aa$ x |
| 40 | 7 (a)(b) abbaa |
| 41 | 8 axx [ab]xx |
| 42 | 9 หม่x อมx |
| 43 | a อมx หม่x |
| 44 | b ちカヨは |