diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-07 22:18:52 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-07 22:18:52 +0200 |
commit | 1c6737b20a5cf71751b180461cea22fc76d8870c (patch) | |
tree | b4fb75497cb2c47f09de1de5bea821af222756ce /runtime/doc/pattern.txt | |
parent | 9c929713b7588f2e44a1533809d2ba0bbd2631be (diff) |
Update runtime files.
Diffstat (limited to 'runtime/doc/pattern.txt')
-rw-r--r-- | runtime/doc/pattern.txt | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index f9a34d4a2d..19edb7268b 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 8.2. Last change: 2020 Aug 15 +*pattern.txt* For Vim version 8.2. Last change: 2020 Sep 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -797,11 +797,12 @@ An ordinary atom can be: ^beep( the start of the C function "beep" (probably). */\^* -\^ Matches literal '^'. Can be used at any position in the pattern. +\^ Matches literal '^'. Can be used at any position in the pattern, but + not inside []. */\_^* \_^ Matches start-of-line. |/zero-width| Can be used at any position in - the pattern. + the pattern, but not inside []. Example matches ~ \_s*\_^foo white space and blank lines and then "foo" at start-of-line @@ -812,12 +813,13 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): |/zero-width| */\$* -\$ Matches literal '$'. Can be used at any position in the pattern. +\$ Matches literal '$'. Can be used at any position in the pattern, but + not inside []. */\_$* \_$ Matches end-of-line. |/zero-width| Can be used at any position in the - pattern. Note that "a\_$b" never matches, since "b" cannot match an - end-of-line. Use "a\nb" instead |/\n|. + pattern, but not inside []. Note that "a\_$b" never matches, since + "b" cannot match an end-of-line. Use "a\nb" instead |/\n|. Example matches ~ foo\_$\_s* "foo" at end-of-line and following white space and blank lines @@ -840,8 +842,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): |/zero-width| */\zs* -\zs Matches at any position, and sets the start of the match there: The - next char is the first char of the whole match. |/zero-width| +\zs Matches at any position, but not inside [], and sets the start of the + match there: The next char is the first char of the whole match. + |/zero-width| Example: > /^\s*\zsif < matches an "if" at the start of a line, ignoring white space. @@ -852,8 +855,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): This cannot be followed by a multi. *E888* {not available when compiled without the |+syntax| feature} */\ze* -\ze Matches at any position, and sets the end of the match there: The - previous char is the last char of the whole match. |/zero-width| +\ze Matches at any position, but not inside [], and sets the end of the + match there: The previous char is the last char of the whole match. + |/zero-width| Can be used multiple times, the last one encountered in a matching branch is used. Example: "end\ze\(if\|for\)" matches the "end" in "endif" and |