diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2019-12-26 14:53:24 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2019-12-26 14:53:24 +0000 |
commit | 50ffe28edeacc750dcfa3f1d3c0c89f003686860 (patch) | |
tree | d9bd1a03bf5734b32f209b4c4d62486d973b8ef3 /doc/html | |
parent | ea9d40470130e4e235717be247c5b3e6e79f12ba (diff) | |
download | pcre2-50ffe28edeacc750dcfa3f1d3c0c89f003686860.tar.gz |
Implement PCRE2_SUBSTITUTE_LITERAL.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1194 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'doc/html')
-rw-r--r-- | doc/html/pcre2_substitute.html | 5 | ||||
-rw-r--r-- | doc/html/pcre2api.html | 19 | ||||
-rw-r--r-- | doc/html/pcre2test.html | 9 |
3 files changed, 24 insertions, 9 deletions
diff --git a/doc/html/pcre2_substitute.html b/doc/html/pcre2_substitute.html index 2215ce9..295ca1f 100644 --- a/doc/html/pcre2_substitute.html +++ b/doc/html/pcre2_substitute.html @@ -74,10 +74,15 @@ zero-terminated strings. The options are: PCRE2_UTF was set at compile time) PCRE2_SUBSTITUTE_EXTENDED Do extended replacement processing PCRE2_SUBSTITUTE_GLOBAL Replace all occurrences in the subject + PCRE2_SUBSTITUTE_LITERAL The replacement string is literal PCRE2_SUBSTITUTE_OVERFLOW_LENGTH If overflow, compute needed length PCRE2_SUBSTITUTE_UNKNOWN_UNSET Treat unknown group as unset PCRE2_SUBSTITUTE_UNSET_EMPTY Simple unset insert = empty string </pre> +PCRE2_SUBSTITUTE_LITERAL overrides PCRE2_SUBSTITUTE_EXTENDED, +PCRE2_SUBSTITUTE_UNKNOWN_UNSET, and PCRE2_SUBSTITUTE_UNSET_EMPTY. +</P> +<P> The function returns the number of substitutions, which may be zero if there were no matches. The result can be greater than one only when PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code diff --git a/doc/html/pcre2api.html b/doc/html/pcre2api.html index 82aabee..585386d 100644 --- a/doc/html/pcre2api.html +++ b/doc/html/pcre2api.html @@ -3349,11 +3349,12 @@ of giving an error return as soon as the buffer overflows. Note also that the length is in code units, not bytes. </P> <P> -In the replacement string, which is interpreted as a UTF string in UTF mode, -and is checked for UTF validity unless the PCRE2_NO_UTF_CHECK option is set, a -dollar character is an escape character that can specify the insertion of -characters from capture groups or names from (*MARK) or other control verbs -in the pattern. The following forms are always recognized: +The replacement string, which is interpreted as a UTF string in UTF mode, +is checked for UTF validity unless the PCRE2_NO_UTF_CHECK option is set. If the +PCRE2_SUBSTITUTE_LITERAL option is set, it is not interpreted in any way. By +default, however, a dollar character is an escape character that can specify +the insertion of characters from capture groups or names from (*MARK) or other +control verbs in the pattern. The following forms are always recognized: <pre> $$ insert a dollar character $<n> or ${<n>} insert the contents of group <n> @@ -3381,6 +3382,12 @@ As well as the usual options for <b>pcre2_match()</b>, a number of additional options can be set in the <i>options</i> argument of <b>pcre2_substitute()</b>. </P> <P> +As mentioned above, PCRE2_SUBSTITUTE_LITERAL causes the replacement string to +be treated as a literal, with no interpretation. If this option is set, +PCRE2_SUBSTITUTE_EXTENDED, PCRE2_SUBSTITUTE_UNKNOWN_UNSET, and +PCRE2_SUBSTITUTE_UNSET_EMPTY are irrelevant and are ignored. +</P> +<P> PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject string, replacing every matching substring. If this option is not set, only the first matching substring is replaced. The search for matches takes place in the @@ -3869,7 +3876,7 @@ Cambridge, England. </P> <br><a name="SEC42" href="#TOC1">REVISION</a><br> <P> -Last updated: 02 September 2019 +Last updated: 26 December 2019 <br> Copyright © 1997-2019 University of Cambridge. <br> diff --git a/doc/html/pcre2test.html b/doc/html/pcre2test.html index e387315..c73d360 100644 --- a/doc/html/pcre2test.html +++ b/doc/html/pcre2test.html @@ -1063,8 +1063,9 @@ process. startchar show starting character when relevant substitute_callout use substitution callouts substitute_extended use PCRE2_SUBSTITUTE_EXTENDED - substitute_skip=<n> skip substitution number n + substitute_literal use PCRE2_SUBSTITUTE_LITERAL substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + substitute_skip=<n> skip substitution number n substitute_stop=<n> skip substitution number n and greater substitute_unknown_unset use PCRE2_SUBSTITUTE_UNKNOWN_UNSET substitute_unset_empty use PCRE2_SUBSTITUTE_UNSET_EMPTY @@ -1233,8 +1234,9 @@ pattern. startoffset=<n> same as offset=<n> substitute_callout use substitution callouts substitute_extedded use PCRE2_SUBSTITUTE_EXTENDED - substitute_skip=<n> skip substitution number n + substitute_literal use PCRE2_SUBSTITUTE_LITERAL substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + substitute_skip=<n> skip substitution number n substitute_stop=<n> skip substitution number n and greater substitute_unknown_unset use PCRE2_SUBSTITUTE_UNKNOWN_UNSET substitute_unset_empty use PCRE2_SUBSTITUTE_UNSET_EMPTY @@ -1413,6 +1415,7 @@ for <b>pcre2_substitute()</b>: <pre> global PCRE2_SUBSTITUTE_GLOBAL substitute_extended PCRE2_SUBSTITUTE_EXTENDED + substitute_literal PCRE2_SUBSTITUTE_LITERAL substitute_overflow_length PCRE2_SUBSTITUTE_OVERFLOW_LENGTH substitute_unknown_unset PCRE2_SUBSTITUTE_UNKNOWN_UNSET substitute_unset_empty PCRE2_SUBSTITUTE_UNSET_EMPTY @@ -2093,7 +2096,7 @@ Cambridge, England. </P> <br><a name="SEC21" href="#TOC1">REVISION</a><br> <P> -Last updated: 30 July 2019 +Last updated: 26 December 2019 <br> Copyright © 1997-2019 University of Cambridge. <br> |