summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-11-21 16:10:24 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-11-21 16:10:24 +0000
commitbc8c0c5af4c14593bb67fe7fefb7a10944ae65a3 (patch)
tree7450e393ab75fa16a74af9c6500728bae34ae6fb
parentef0ca2ce831af44736a9e7f31ae56252f115b37e (diff)
downloadpcre2-bc8c0c5af4c14593bb67fe7fefb7a10944ae65a3.tar.gz
Make startoffset a synonym of offset in pcre2test.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@444 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog3
-rw-r--r--doc/pcre2test.15
-rw-r--r--src/pcre2test.c1
-rw-r--r--testdata/testinput22
-rw-r--r--testdata/testoutput22
5 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 224b3d7..c103cce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
--------------------------
diff --git a/doc/pcre2test.1 b/doc/pcre2test.1
index 1f61fe9..cfdec81 100644
--- a/doc/pcre2test.1
+++ b/doc/pcre2test.1
@@ -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
diff --git a/src/pcre2test.c b/src/pcre2test.c
index 37eeada..8ab7b56 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -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) },
diff --git a/testdata/testinput2 b/testdata/testinput2
index dfd1aa8..9b6052d 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -1328,7 +1328,7 @@
ab cd\=offset=1
/\b.*/Is
- ab cd\=offset=1
+ ab cd\=startoffset=1
/(?!.bcd).*/I
Xbcd12345
diff --git a/testdata/testoutput2 b/testdata/testoutput2
index e5350d5..d44e79b 100644
--- a/testdata/testoutput2
+++ b/testdata/testoutput2
@@ -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