From 85fc061dcf1448ff9d562969dd295d6a62287d84 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Wed, 28 Apr 2021 14:21:38 +0000 Subject: [PATCH] Documentation and tests update. --- doc/pcre2.3 | 15 ++++++++++----- doc/pcre2test.1 | 12 ++++++++---- testdata/testinput2 | 13 +++++++++++++ testdata/testoutput2 | 20 ++++++++++++++++++++ 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/doc/pcre2.3 b/doc/pcre2.3 index 75450ec..efe41c5 100644 --- a/doc/pcre2.3 +++ b/doc/pcre2.3 @@ -1,4 +1,4 @@ -.TH PCRE2 3 "17 September 2018" "PCRE2 10.33" +.TH PCRE2 3 "28 April 2021" "PCRE2 10.37" .SH NAME PCRE2 - Perl-compatible regular expressions (revised API) .SH INTRODUCTION @@ -19,8 +19,13 @@ using the Python syntax. There is also some support for one or two .NET and Oniguruma syntax items, and there are options for requesting some minor changes that give better ECMAScript (aka JavaScript) compatibility. .P -The source code for PCRE2 can be compiled to support 8-bit, 16-bit, or 32-bit -code units, which means that up to three separate libraries may be installed. +The source code for PCRE2 can be compiled to support strings of 8-bit, 16-bit, +or 32-bit code units, which means that up to three separate libraries may be +installed, one for each code unit size. The size of code unit is not related to +the bit size of the underlying hardware. In a 64-bit environment that also +supports 32-bit applications, versions of PCRE2 that are compiled in both +64-bit and 32-bit modes may be needed. +.P The original work to extend PCRE to 16-bit and 32-bit code units was done by Zoltan Herczeg and Christian Persch, respectively. In all three cases, strings can be interpreted either as one character per code unit, or as UTF-encoded @@ -197,6 +202,6 @@ use my two initials, followed by the two digits 10, at the domain cam.ac.uk. .rs .sp .nf -Last updated: 17 September 2018 -Copyright (c) 1997-2018 University of Cambridge. +Last updated: 28 April 2021 +Copyright (c) 1997-2021 University of Cambridge. .fi diff --git a/doc/pcre2test.1 b/doc/pcre2test.1 index c63f03d..7331e2e 100644 --- a/doc/pcre2test.1 +++ b/doc/pcre2test.1 @@ -1,4 +1,4 @@ -.TH PCRE2TEST 1 "14 September 2020" "PCRE 10.36" +.TH PCRE2TEST 1 "28 April 2021" "PCRE 10.37" .SH NAME pcre2test - a program for testing Perl-compatible regular expressions. .SH SYNOPSIS @@ -1180,7 +1180,7 @@ its input), you must use \fBposix_startend\fP to specify its length. The following modifiers affect the matching process or request additional information. Some of them may also be specified on a pattern line (see above), in which case they apply to every subject line that is matched against that -pattern. +pattern, but can be overridden by modifiers on the subject. .sp aftertext show text after match allaftertext show text after captures @@ -1389,6 +1389,10 @@ called instead of one of the matching functions (or after one call of 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 +Specifying a completely empty replacement string disables this modifier. +However, it is possible to specify an empty replacement by providing a buffer +length, as described below, for an otherwise empty replacement. +.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 @@ -2101,6 +2105,6 @@ Cambridge, England. .rs .sp .nf -Last updated: 14 September 2020 -Copyright (c) 1997-2020 University of Cambridge. +Last updated: 28 April 2021 +Copyright (c) 1997-2021 University of Cambridge. .fi diff --git a/testdata/testinput2 b/testdata/testinput2 index 87e3394..865c903 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -5830,6 +5830,19 @@ a)"xI /55|a(..)d/g,replace=>$1< xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty + +/abc/replace=,caseless + XabcY + XABCY + +/abc/replace=[4],caseless + XabcY + XABCY + +/abc/replace=*,caseless + XabcY + XABCY + XabcY\=replace= # Expect non-fixed-length error diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 4d8f65d..6065ed7 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -17571,6 +17571,26 @@ Failed: error -55 at offset 3 in replacement: requested value is not set /55|a(..)d/g,replace=>$1< xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty 3: xyz><>bcbc