diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-07-02 10:54:03 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-07-02 10:54:03 +0000 |
commit | 932de012f1ce3ab7abadbc426c7ae47a113847d7 (patch) | |
tree | 7554b994e82f06e87eeb2e6b5b7cf8ca4c6e8438 /doc/html/pcre2pattern.html | |
parent | 728fa15d656290846a5e84ab4f467c8e21dedd2d (diff) | |
download | pcre2-932de012f1ce3ab7abadbc426c7ae47a113847d7.tar.gz |
Fix global search/replace in pcre2test and pcre2_substitute() when the pattern
matches an empty string, but never at the starting offset.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@955 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'doc/html/pcre2pattern.html')
-rw-r--r-- | doc/html/pcre2pattern.html | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/html/pcre2pattern.html b/doc/html/pcre2pattern.html index f07041b..9adc426 100644 --- a/doc/html/pcre2pattern.html +++ b/doc/html/pcre2pattern.html @@ -1084,9 +1084,9 @@ sequences but the characters that they represent.) Resetting the match start </b><br> <P> -The escape sequence \K causes any previously matched characters not to be -included in the final matched sequence that is returned. For example, the -pattern: +In normal use, the escape sequence \K causes any previously matched characters +not to be included in the final matched sequence that is returned. For example, +the pattern: <pre> foo\Kbar </pre> @@ -1115,7 +1115,13 @@ PCRE2, \K is acted upon when it occurs inside positive assertions, but is ignored in negative assertions. Note that when a pattern such as (?=ab\K) matches, the reported start of the match can be greater than the end of the match. Using \K in a lookbehind assertion at the start of a pattern can also -lead to odd effects. +lead to odd effects. For example, consider this pattern: +<pre> + (?<=\Kfoo)bar +</pre> +If the subject is "foobar", a call to <b>pcre2_match()</b> with a starting +offset of 3 succeeds and reports the matching string as "foobar", that is, the +start of the reported match is earlier than where the match started. <a name="smallassertions"></a></P> <br><b> Simple assertions @@ -3484,7 +3490,7 @@ Cambridge, England. </P> <br><a name="SEC30" href="#TOC1">REVISION</a><br> <P> -Last updated: 28 June 2018 +Last updated: 30 June 2018 <br> Copyright © 1997-2018 University of Cambridge. <br> |