diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-22 22:33:57 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-22 22:33:57 +0000 |
commit | eb3593b38b7b6b658e93ad05d6caf76d58cc0c35 (patch) | |
tree | 39210f19a86e4db2914523b0fde4a5ff9d345c16 /runtime/doc/pattern.txt | |
parent | 57657d85c6c3d812e99b5e5d5161c07c66ac7dc7 (diff) | |
download | vim-git-eb3593b38b7b6b658e93ad05d6caf76d58cc0c35.tar.gz |
updated for version 7.0e06v7.0e06
Diffstat (limited to 'runtime/doc/pattern.txt')
-rw-r--r-- | runtime/doc/pattern.txt | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 5a37a8dda..3c021d8f7 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.0e. Last change: 2006 Apr 02 +*pattern.txt* For Vim version 7.0e. Last change: 2006 Apr 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -342,6 +342,50 @@ For starters, read chapter 27 of the user manual |usr_27.txt|. ============================================================================== +3. Magic */magic* + +Some characters in the pattern are taken literally. They match with the same +character in the text. When preceded with a backslash however, these +characters get a special meaning. + +Other characters have a special meaning without a backslash. They need to be +preceded with a backslash to match literally. + +If a character is taken literally or not depends on the 'magic' option and the +items mentioned next. + */\m* */\M* +Use of "\m" makes the pattern after it be interpreted as if 'magic' is set, +ignoring the actual value of the 'magic' option. +Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used. + */\v* */\V* +Use of "\v" means that in the pattern after it all ASCII characters except +'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic" + +Use of "\V" means that in the pattern after it only the backslash has a +special meaning. "very nomagic" + +Examples: +after: \v \m \M \V matches ~ + 'magic' 'nomagic' + $ $ $ \$ matches end-of-line + . . \. \. matches any character + * * \* \* any number of the previous atom + () \(\) \(\) \(\) grouping into an atom + | \| \| \| separating alternatives + \a \a \a \a alphabetic character + \\ \\ \\ \\ literal backslash + \. \. . . literal dot + \{ { { { literal '{' + a a a a literal 'a' + +{only Vim supports \m, \M, \v and \V} + +It is recommended to always keep the 'magic' option at the default setting, +which is 'magic'. This avoids portability problems. To make a pattern immune +to the 'magic' option being set or not, put "\m" or "\M" at the start of the +pattern. + +============================================================================== 4. Overview of pattern items *pattern-overview* Overview of multi items. */multi* *E61* *E62* @@ -486,51 +530,6 @@ cat\Z Both "cat" and "càt" ("a" followed by 0x0300) ============================================================================== -3. Magic */magic* - -Some characters in the pattern are taken literally. They match with the same -character in the text. When preceded with a backslash however, these -characters get a special meaning. - -Other characters have a special meaning without a backslash. They need to be -preceded with a backslash to match literally. - -If a character is taken literally or not depends on the 'magic' option and the -items mentioned next. - */\m* */\M* -Use of "\m" makes the pattern after it be interpreted as if 'magic' is set, -ignoring the actual value of the 'magic' option. -Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used. - */\v* */\V* -Use of "\v" means that in the pattern after it all ASCII characters except -'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic" - -Use of "\V" means that in the pattern after it only the backslash has a -special meaning. "very nomagic" - -Examples: -after: \v \m \M \V matches ~ - 'magic' 'nomagic' - $ $ $ \$ matches end-of-line - . . \. \. matches any character - * * \* \* any number of the previous atom - () \(\) \(\) \(\) grouping into an atom - | \| \| \| separating alternatives - \a \a \a \a alphabetic character - \\ \\ \\ \\ literal backslash - \. \. . . literal dot - \{ { { { literal '{' - a a a a literal 'a' - -{only Vim supports \m, \M, \v and \V} - -It is recommended to always keep the 'magic' option at the default setting, -which is 'magic'. This avoids portability problems. To make a pattern immune -to the 'magic' option being set or not, put "\m" or "\M" at the start of the -pattern. - - -============================================================================== 5. Multi items *pattern-multi-items* An atom can be followed by an indication of how many times the atom can be |