Skip to content

Commit

Permalink
Increase name length to 128
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipHazel committed Mar 11, 2024
1 parent 3ebcb07 commit ced3b0f
Show file tree
Hide file tree
Showing 10 changed files with 760 additions and 757 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ example pattern is: /(((?<=123?456456|ABC)))(?<=\2)/
(d) Made the output in standalone mode more readable.

(e) General code tidies.

3. Increase the maximum length of a name for a group from 32 to 128 because
there is a user for whom 32 is too small.


Version 10.43 16-February-2024
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dnl The PCRE2_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty.

m4_define(pcre2_major, [10])
m4_define(pcre2_minor, [43])
m4_define(pcre2_prerelease, [])
m4_define(pcre2_date, [2024-02-16])
m4_define(pcre2_minor, [44])
m4_define(pcre2_prerelease, [-DEV])
m4_define(pcre2_date, [2024-03-11])

# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre2_8_version, [12:0:12])
Expand Down Expand Up @@ -883,7 +883,7 @@ AC_DEFINE_UNQUOTED([HEAP_LIMIT], [$with_heap_limit], [
a pattern. It applies to both pcre2_match() and pcre2_dfa_match(). It does
not apply to JIT matching. The value is in kibibytes (units of 1024 bytes).])

AC_DEFINE([MAX_NAME_SIZE], [32], [
AC_DEFINE([MAX_NAME_SIZE], [128], [
This limit is parameterized just in case anybody ever wants to
change it. Care must be taken if it is increased, because it guards
against integer overflow caused by enormously large patterns.])
Expand Down
4 changes: 2 additions & 2 deletions doc/html/pcre2pattern.html
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ <h1>pcre2pattern man page</h1>
</P>
<P>
In PCRE2, a capture group can be named in one of three ways: (?&#60;name&#62;...) or
(?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names may be up to 32
(?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names may be up to 128
code units long. When PCRE2_UTF is not set, they may contain only ASCII
alphanumeric characters and underscores, but must start with a non-digit. When
PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
Expand Down Expand Up @@ -3844,7 +3844,7 @@ <h1>pcre2pattern man page</h1>
</P>
<br><a name="SEC32" href="#TOC1">REVISION</a><br>
<P>
Last updated: 19 January 2024
Last updated: 11 March 2024
<br>
Copyright &copy; 1997-2024 University of Cambridge.
<br>
Expand Down
1,466 changes: 733 additions & 733 deletions doc/pcre2.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/pcre2demo.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH PCRE2DEMO 3 "21 February 2024" "PCRE2 10.43"
.TH PCRE2DEMO 3 "11 March 2024" "PCRE2 10.43"
.\"AUTOMATICALLY GENERATED BY PrepareRelease - do not EDIT!
.SH NAME
PCRE2DEMO - A demonstration C program for PCRE2
Expand Down
6 changes: 3 additions & 3 deletions doc/pcre2pattern.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH PCRE2PATTERN 3 "19 January 2024" "PCRE2 10.43"
.TH PCRE2PATTERN 3 "11 March 2024" "PCRE2 10.44"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH "PCRE2 REGULAR EXPRESSION DETAILS"
Expand Down Expand Up @@ -1844,7 +1844,7 @@ the naming of capture groups. This feature was not added to Perl until release
using the Python syntax. PCRE2 supports both the Perl and the Python syntax.
.P
In PCRE2, a capture group can be named in one of three ways: (?<name>...) or
(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 32
(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 128
code units long. When PCRE2_UTF is not set, they may contain only ASCII
alphanumeric characters and underscores, but must start with a non-digit. When
PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
Expand Down Expand Up @@ -3889,6 +3889,6 @@ Cambridge, England.
.rs
.sp
.nf
Last updated: 19 January 2024
Last updated: 11 March 2024
Copyright (c) 1997-2024 University of Cambridge.
.fi
6 changes: 3 additions & 3 deletions testdata/testinput10
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@

# Check name length with non-ASCII characters

/(?'ABáC678901234567890123456789012'...)/utf
/(?'ABáC678901234567890123456789012012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf

/(?'ABáC6789012345678901234567890123'...)/utf
/(?'ABáC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf

/(?'ABZC6789012345678901234567890123'...)/utf
/(?'ABZC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf

/(?(n/utf

Expand Down
6 changes: 3 additions & 3 deletions testdata/testinput2
Original file line number Diff line number Diff line change
Expand Up @@ -4680,9 +4680,9 @@ B)x/alt_verbnames,mark
/(?<=\K.)/g,replace=-,allow_lookaround_bsk
ab

/(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFGH'toolong)/

/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFG'justright)/

# These two use zero-termination
/abcd/max_pattern_length=3
Expand Down Expand Up @@ -4949,7 +4949,7 @@ a)"xI
/{�̈́�̈́�{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ą̈́�̈́�{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout

//
\=get=i00000000000000000000000000000000
\=get=i00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
\=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012

"(?(?C))"
Expand Down
8 changes: 4 additions & 4 deletions testdata/testoutput10
Original file line number Diff line number Diff line change
Expand Up @@ -1615,12 +1615,12 @@ No match

# Check name length with non-ASCII characters

/(?'ABáC678901234567890123456789012'...)/utf
/(?'ABáC678901234567890123456789012012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf

/(?'ABáC6789012345678901234567890123'...)/utf
Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code units)
/(?'ABáC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
Failed: error 148 at offset 132: subpattern name is too long (maximum 128 code units)

/(?'ABZC6789012345678901234567890123'...)/utf
/(?'ABZC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf

/(?(n/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
Expand Down
8 changes: 4 additions & 4 deletions testdata/testoutput2
Original file line number Diff line number Diff line change
Expand Up @@ -14935,10 +14935,10 @@ Failed: error -60: match with end before start or start moved backwards is not s
ab
Failed: error -60: match with end before start or start moved backwards is not supported

/(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code units)
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFGH'toolong)/
Failed: error 148 at offset 132: subpattern name is too long (maximum 128 code units)

/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFG'justright)/

# These two use zero-termination
/abcd/max_pattern_length=3
Expand Down Expand Up @@ -15549,7 +15549,7 @@ Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed,
/{�̈́�̈́�{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ą̈́�̈́�{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout

//
\=get=i00000000000000000000000000000000
\=get=i00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
** Group name in 'get' is too long
\=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
** Too many characters in named 'get' modifiers
Expand Down

0 comments on commit ced3b0f

Please sign in to comment.