Skip to content

Commit

Permalink
Add more examples fixed by #300; update ChangeLog
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipHazel committed Oct 3, 2023
1 parent 794245e commit 457c0e6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ does the same, except for \u{...}, which is recognized only when
PCRE2_EXTRA_ALT_BSUX is set. This an ECMAScript, non-Perl compatible,
extension, so PCRE2 follows ECMAScript rather than Perl.

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


Version 10.42 11-December-2022
------------------------------
Expand Down
8 changes: 8 additions & 0 deletions testdata/testinput1
Original file line number Diff line number Diff line change
Expand Up @@ -4374,6 +4374,14 @@

/(?<all>(?:(?:a(?&all))|(b))(c?))/
aabc

/(a(b)|(c))(?1)/
abc
cab

/(?1)(a(b)|(c))/
abc
cab

/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
(?(DEFINE)
Expand Down
22 changes: 22 additions & 0 deletions testdata/testoutput1
Original file line number Diff line number Diff line change
Expand Up @@ -6954,6 +6954,28 @@ No match
1: aabc
2: <unset>
3:

/(a(b)|(c))(?1)/
abc
0: abc
1: ab
2: b
cab
0: cab
1: c
2: <unset>
3: c

/(?1)(a(b)|(c))/
abc
0: abc
1: c
2: <unset>
3: c
cab
0: cab
1: ab
2: b

/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
(?(DEFINE)
Expand Down

0 comments on commit 457c0e6

Please sign in to comment.