Skip to content

Commit 457c0e6

Browse files
committed
Add more examples fixed by #300; update ChangeLog
1 parent 794245e commit 457c0e6

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ does the same, except for \u{...}, which is recognized only when
119119
PCRE2_EXTRA_ALT_BSUX is set. This an ECMAScript, non-Perl compatible,
120120
extension, so PCRE2 follows ECMAScript rather than Perl.
121121

122+
31. Applied pull request #300 bu Carlo, which fixes #261. The bug was that
123+
pcre2_match() was not fully resetting all captures that had been set within a
124+
(possibly recursive) subroutine call such as (?3).
125+
122126

123127
Version 10.42 11-December-2022
124128
------------------------------

testdata/testinput1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4374,6 +4374,14 @@
43744374

43754375
/(?<all>(?:(?:a(?&all))|(b))(c?))/
43764376
aabc
4377+
4378+
/(a(b)|(c))(?1)/
4379+
abc
4380+
cab
4381+
4382+
/(?1)(a(b)|(c))/
4383+
abc
4384+
cab
43774385

43784386
/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
43794387
(?(DEFINE)

testdata/testoutput1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6954,6 +6954,28 @@ No match
69546954
1: aabc
69556955
2: <unset>
69566956
3:
6957+
6958+
/(a(b)|(c))(?1)/
6959+
abc
6960+
0: abc
6961+
1: ab
6962+
2: b
6963+
cab
6964+
0: cab
6965+
1: c
6966+
2: <unset>
6967+
3: c
6968+
6969+
/(?1)(a(b)|(c))/
6970+
abc
6971+
0: abc
6972+
1: c
6973+
2: <unset>
6974+
3: c
6975+
cab
6976+
0: cab
6977+
1: ab
6978+
2: b
69576979

69586980
/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
69596981
(?(DEFINE)

0 commit comments

Comments
 (0)