Make startoffset a synonym of offset in pcre2test.

This commit is contained in:
Philip.Hazel 2015-11-21 16:10:24 +00:00
parent 11e0001b14
commit c7e9887a65
5 changed files with 9 additions and 4 deletions

View File

@ -327,6 +327,9 @@ property was also in the class (if PCRE2_UCP is set, escapes such as \w are
turned into Unicode properties), wide characters were not correctly handled,
and could fail to match.
98. In pcre2test, make the "startoffset" modifier a synonym of "offset",
because it sets the "startoffset" parameter for pcre2_match().
Version 10.20 30-June-2015
--------------------------

View File

@ -1,4 +1,4 @@
.TH PCRE2TEST 1 "14 November 2015" "PCRE 10.21"
.TH PCRE2TEST 1 "21 November 2015" "PCRE 10.21"
.SH NAME
pcre2test - a program for testing Perl-compatible regular expressions.
.SH SYNOPSIS
@ -959,6 +959,7 @@ pattern.
recursion_limit=<n> set a recursion limit
replace=<string> specify a replacement string
startchar show startchar when relevant
startoffset=<n> same as offset=<n>
zero_terminate pass the subject as zero-terminated
.sp
The effects of these modifiers are described in the following sections.
@ -1609,6 +1610,6 @@ Cambridge, England.
.rs
.sp
.nf
Last updated: 14 November 2015
Last updated: 21 November 2015
Copyright (c) 1997-2015 University of Cambridge.
.fi

View File

@ -572,6 +572,7 @@ static modstruct modlist[] = {
{ "replace", MOD_PND, MOD_STR, REPLACE_MODSIZE, PO(replacement) },
{ "stackguard", MOD_PAT, MOD_INT, 0, PO(stackguard_test) },
{ "startchar", MOD_PND, MOD_CTL, CTL_STARTCHAR, PO(control) },
{ "startoffset", MOD_DAT, MOD_INT, 0, DO(offset) },
{ "substitute_extended", MOD_PAT, MOD_CTL, CTL_SUBSTITUTE_EXTENDED, PO(control) },
{ "tables", MOD_PAT, MOD_INT, 0, PO(tables_id) },
{ "ucp", MOD_PATP, MOD_OPT, PCRE2_UCP, PO(options) },

2
testdata/testinput2 vendored
View File

@ -1328,7 +1328,7 @@
ab cd\=offset=1
/\b.*/Is
ab cd\=offset=1
ab cd\=startoffset=1
/(?!.bcd).*/I
Xbcd12345

View File

@ -5181,7 +5181,7 @@ Max lookbehind = 1
May match empty string
Options: dotall
Subject length lower bound = 0
ab cd\=offset=1
ab cd\=startoffset=1
0: cd
/(?!.bcd).*/I