summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-11-14 17:08:03 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-11-14 17:08:03 +0000
commitd294fed808b68466ee5fdc872ce0718b644091a8 (patch)
treee39901d39cf8b692457650a15825680617d0a617
parent8ccf72daf9ea0d39df02e3d46d594898b6ad7e2e (diff)
downloadpcre2-d294fed808b68466ee5fdc872ce0718b644091a8.tar.gz
Documentation improvement.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@435 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--doc/pcre2test.133
1 files changed, 18 insertions, 15 deletions
diff --git a/doc/pcre2test.1 b/doc/pcre2test.1
index 2b01eb6..1f61fe9 100644
--- a/doc/pcre2test.1
+++ b/doc/pcre2test.1
@@ -1,4 +1,4 @@
-.TH PCRE2TEST 1 "05 November 2015" "PCRE 10.21"
+.TH PCRE2TEST 1 "14 November 2015" "PCRE 10.21"
.SH NAME
pcre2test - a program for testing Perl-compatible regular expressions.
.SH SYNOPSIS
@@ -1091,13 +1091,16 @@ by name.
.rs
.sp
If the \fBreplace\fP modifier is set, the \fBpcre2_substitute()\fP function is
-called instead of one of the matching functions. Unlike subject strings,
-\fBpcre2test\fP does not process replacement strings for escape sequences. In
-UTF mode, a replacement string is checked to see if it is a valid UTF-8 string.
-If so, it is correctly converted to a UTF string of the appropriate code unit
-width. If it is not a valid UTF-8 string, the individual code units are copied
-directly. This provides a means of passing an invalid UTF-8 string for testing
-purposes.
+called instead of one of the matching functions. Note that replacement strings
+cannot contain commas, because a comma signifies the end of a modifier. This is
+not thought to be an issue in a test program.
+.P
+Unlike subject strings, \fBpcre2test\fP does not process replacement strings
+for escape sequences. In UTF mode, a replacement string is checked to see if it
+is a valid UTF-8 string. If so, it is correctly converted to a UTF string of
+the appropriate code unit width. If it is not a valid UTF-8 string, the
+individual code units are copied directly. This provides a means of passing an
+invalid UTF-8 string for testing purposes.
.P
If the \fBglobal\fP modifier is set, PCRE2_SUBSTITUTE_GLOBAL is passed to
\fBpcre2_substitute()\fP. After a successful substitution, the modified string
@@ -1110,12 +1113,12 @@ were no matches. Here is a simple example of a substitution test:
=abc=abc=\e=global
2: =xxx=xxx=
.sp
-Subject and replacement strings should be kept relatively short for
-substitution tests, as fixed-size buffers are used. To make it easy to test for
-buffer overflow, if the replacement string starts with a number in square
-brackets, that number is passed to \fBpcre2_substitute()\fP as the size of the
-output buffer, with the replacement string starting at the next character. Here
-is an example that tests the edge case:
+Subject and replacement strings should be kept relatively short (fewer than 256
+characters) for substitution tests, as fixed-size buffers are used. To make it
+easy to test for buffer overflow, if the replacement string starts with a
+number in square brackets, that number is passed to \fBpcre2_substitute()\fP as
+the size of the output buffer, with the replacement string starting at the next
+character. Here is an example that tests the edge case:
.sp
/abc/
123abc123\e=replace=[10]XYZ
@@ -1606,6 +1609,6 @@ Cambridge, England.
.rs
.sp
.nf
-Last updated: 05 November 2015
+Last updated: 14 November 2015
Copyright (c) 1997-2015 University of Cambridge.
.fi