comparison runtime/doc/pattern.txt @ 24:8ff7fd162d3c v7.0016

updated for version 7.0016
author vimboss
date Mon, 13 Sep 2004 20:26:32 +0000
parents 4ac1dce8dd5e
children 410fa1a31baf
comparison
equal deleted inserted replaced
23:3f44e9abe4ec 24:8ff7fd162d3c
1 *pattern.txt* For Vim version 7.0aa. Last change: 2004 Jul 24 1 *pattern.txt* For Vim version 7.0aa. Last change: 2004 Sep 07
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
429 |/\z1| \z9 \z9 only for syntax highlighting, see |:syn-ext-match| 429 |/\z1| \z9 \z9 only for syntax highlighting, see |:syn-ext-match|
430 430
431 x x a character with no special meaning matches itself 431 x x a character with no special meaning matches itself
432 432
433 |/[]| [] \[] any character specified inside the [] 433 |/[]| [] \[] any character specified inside the []
434 |/\%[]| \%[] \%[] a list of optionally matched atoms 434 |/\%[]| \%[] \%[] a sequence of optionally matched atoms
435 435
436 |/\c| \c \c ignore case 436 |/\c| \c \c ignore case
437 |/\C| \C \C match case 437 |/\C| \C \C match case
438 |/\m| \m \m 'magic' on for the following chars in the pattern 438 |/\m| \m \m 'magic' on for the following chars in the pattern
439 |/\M| \M \M 'magic' off for the following chars in the pattern 439 |/\M| \M \M 'magic' off for the following chars in the pattern
440 |/\v| \v \v the following chars in the pattern are "very magic" 440 |/\v| \v \v the following chars in the pattern are "very magic"
441 |/\V| \V \V the following chars in the pattern are "very nomagic" 441 |/\V| \V \V the following chars in the pattern are "very nomagic"
442 |/\Z| \Z \Z ignore differences in Unicode "combining characters". 442 |/\Z| \Z \Z ignore differences in Unicode "combining characters".
443 Useful when searching voweled Hebrew or Arabic text. 443 Useful when searching voweled Hebrew or Arabic text.
444 444
445 |/\%d| \%d \%d match specified decimal character (eg \%d123
446 |/\%x| \%x \%x match specified hex character (eg \%x2a)
447 |/\%o| \%o \%o match specified octal character (eg \%o040)
448 |/\%u| \%u \%u match specified multibyte character (eg \%u20ac)
449 |/\%U| \%U \%U match specified large multibyte character (eg
450 \%U12345678)
445 451
446 Example matches ~ 452 Example matches ~
447 \<\I\i* or 453 \<\I\i* or
448 \<\h\w* 454 \<\h\w*
449 \<[a-zA-Z_][a-zA-Z0-9_]* 455 \<[a-zA-Z_][a-zA-Z0-9_]*
986 included in 'cpoptions' {not in Vi}: 992 included in 'cpoptions' {not in Vi}:
987 \e <Esc> 993 \e <Esc>
988 \t <Tab> 994 \t <Tab>
989 \r <CR> (NOT end-of-line!) 995 \r <CR> (NOT end-of-line!)
990 \b <BS> 996 \b <BS>
997 \d123 decimal number of character
998 \o40 octal number of character up to 0377
999 \x20 hexadecimal number of character up to 0xff
1000 \u20AC hex. number of multibyte character up to 0xffff
1001 \U1234 hex. number of multibyte character up to 0xffffffff
991 NOTE: The other backslash codes mentioned above do not work inside 1002 NOTE: The other backslash codes mentioned above do not work inside
992 []! 1003 []!
993 - Matching with a collection can be slow, because each character in 1004 - Matching with a collection can be slow, because each character in
994 the text has to be compared with each character in the collection. 1005 the text has to be compared with each character in the collection.
995 Use one of the other atoms above when possible. Example: "\d" is 1006 Use one of the other atoms above when possible. Example: "\d" is
996 much faster than "[0-9]" and matches the same characters. 1007 much faster than "[0-9]" and matches the same characters.
997 1008
998 */\%[]* *E69* *E70* *E369* 1009 */\%[]* *E69* *E70* *E369*
999 \%[] A list of optionally matched atoms. This always matches. 1010 \%[] A sequence of optionally matched atoms. This always matches.
1000 It matches as much of the list of atoms it contains as possible. Thus 1011 It matches as much of the list of atoms it contains as possible. Thus
1001 it stops at the first atom that doesn't match. For example: > 1012 it stops at the first atom that doesn't match. For example: >
1002 /r\%[ead] 1013 /r\%[ead]
1003 < matches "r", "re", "rea" or "read". The longest that matches is used. 1014 < matches "r", "re", "rea" or "read". The longest that matches is used.
1004 To match the Ex command "function", where "fu" is required and 1015 To match the Ex command "function", where "fu" is required and
1009 You don't often have to use it, but it is possible. Example: > 1020 You don't often have to use it, but it is possible. Example: >
1010 /\<r\%[[eo]ad]\> 1021 /\<r\%[[eo]ad]\>
1011 < Matches the words "r", "re", "ro", "rea", "roa", "read" and "road". 1022 < Matches the words "r", "re", "ro", "rea", "roa", "read" and "road".
1012 {not available when compiled without the +syntax feature} 1023 {not available when compiled without the +syntax feature}
1013 1024
1025 */\%d* */\%x* */\%o* */\%u* */\%U/* *E678*
1026
1027 \%d123 Matches the character specified with a decimal number. Must be
1028 followed by a non-digit.
1029 \%o40 Matches the character specified with an octal number up to 0377.
1030 Numbers below 040 must be followed by a non-octal digit or a non-digit.
1031 \%x2a Matches the character specified with up to two hexadecimal characters.
1032 \%u20AC Matches the character specified with up to four hexadecimal
1033 characters.
1034 \%U1234abcd Matches the character specified with up to eight hexadecimal
1035 characters.
1014 1036
1015 ============================================================================== 1037 ==============================================================================
1016 7. Ignoring case in a pattern */ignorecase* 1038 7. Ignoring case in a pattern */ignorecase*
1017 1039
1018 If the 'ignorecase' option is on, the case of normal letters is ignored. 1040 If the 'ignorecase' option is on, the case of normal letters is ignored.