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 | /ã¡\<ã«ã¨\>㯠|
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame^] | 24 | x:" Test \%u, [\u] and friends |
| 25 | /\%u20ac |
| 26 | x/[\u4f7f\u5929]\+ |
| 27 | x/\%U12345678 |
| 28 | x/[\U1234abcd\u1234\uabcd] |
| 29 | x/\%d21879b |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 30 | x:?^1?,$w! test.out |
Bram Moolenaar | 89cb5e0 | 2004-07-19 20:55:54 +0000 | [diff] [blame] | 31 | :e! test.out |
| 32 | G:put =matchstr(\"××××\", \".\", 0, 2) " × |
| 33 | :put =matchstr(\"××××\", \"..\", 0, 2) " ×× |
| 34 | :put =matchstr(\"××××\", \".\", 0, 0) " × |
| 35 | :put =matchstr(\"××××\", \".\", 4, -1) " × |
| 36 | :w! |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 37 | :qa! |
| 38 | ENDTEST |
| 39 | |
| 40 | 1 a aa abb abbccc |
| 41 | 2 d dd dee deefff |
| 42 | 3 g gg ghh ghhiii |
| 43 | 4 j jj jkk jkklll |
| 44 | 5 m mm mnn mnnooo |
| 45 | 6 x ^aa$ x |
| 46 | 7 (a)(b) abbaa |
| 47 | 8 axx [ab]xx |
| 48 | 9 หมà¹x à¸à¸¡x |
| 49 | a à¸à¸¡x หมà¹x |
| 50 | b ã¡ã«ã¨ã¯ |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame^] | 51 | c x ¬â¬x |
| 52 | d 天使x |
| 53 | e ü
¸y |
| 54 | f ü¯z |
| 55 | g aå·bb |