Skip to content

Commit ced3b0f

Browse files
committed
Increase name length to 128
1 parent 3ebcb07 commit ced3b0f

10 files changed

+760
-757
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ example pattern is: /(((?<=123?456456|ABC)))(?<=\2)/
2727
(d) Made the output in standalone mode more readable.
2828

2929
(e) General code tidies.
30+
31+
3. Increase the maximum length of a name for a group from 32 to 128 because
32+
there is a user for whom 32 is too small.
3033

3134

3235
Version 10.43 16-February-2024

configure.ac

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dnl The PCRE2_PRERELEASE feature is for identifying release candidates. It might
99
dnl be defined as -RC2, for example. For real releases, it should be empty.
1010

1111
m4_define(pcre2_major, [10])
12-
m4_define(pcre2_minor, [43])
13-
m4_define(pcre2_prerelease, [])
14-
m4_define(pcre2_date, [2024-02-16])
12+
m4_define(pcre2_minor, [44])
13+
m4_define(pcre2_prerelease, [-DEV])
14+
m4_define(pcre2_date, [2024-03-11])
1515

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

886-
AC_DEFINE([MAX_NAME_SIZE], [32], [
886+
AC_DEFINE([MAX_NAME_SIZE], [128], [
887887
This limit is parameterized just in case anybody ever wants to
888888
change it. Care must be taken if it is increased, because it guards
889889
against integer overflow caused by enormously large patterns.])

doc/html/pcre2pattern.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ <h1>pcre2pattern man page</h1>
18431843
</P>
18441844
<P>
18451845
In PCRE2, a capture group can be named in one of three ways: (?&#60;name&#62;...) or
1846-
(?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names may be up to 32
1846+
(?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names may be up to 128
18471847
code units long. When PCRE2_UTF is not set, they may contain only ASCII
18481848
alphanumeric characters and underscores, but must start with a non-digit. When
18491849
PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
@@ -3844,7 +3844,7 @@ <h1>pcre2pattern man page</h1>
38443844
</P>
38453845
<br><a name="SEC32" href="#TOC1">REVISION</a><br>
38463846
<P>
3847-
Last updated: 19 January 2024
3847+
Last updated: 11 March 2024
38483848
<br>
38493849
Copyright &copy; 1997-2024 University of Cambridge.
38503850
<br>

doc/pcre2.txt

Lines changed: 733 additions & 733 deletions
Large diffs are not rendered by default.

doc/pcre2demo.3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH PCRE2DEMO 3 "21 February 2024" "PCRE2 10.43"
1+
.TH PCRE2DEMO 3 "11 March 2024" "PCRE2 10.43"
22
.\"AUTOMATICALLY GENERATED BY PrepareRelease - do not EDIT!
33
.SH NAME
44
PCRE2DEMO - A demonstration C program for PCRE2

doc/pcre2pattern.3

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH PCRE2PATTERN 3 "19 January 2024" "PCRE2 10.43"
1+
.TH PCRE2PATTERN 3 "11 March 2024" "PCRE2 10.44"
22
.SH NAME
33
PCRE2 - Perl-compatible regular expressions (revised API)
44
.SH "PCRE2 REGULAR EXPRESSION DETAILS"
@@ -1844,7 +1844,7 @@ the naming of capture groups. This feature was not added to Perl until release
18441844
using the Python syntax. PCRE2 supports both the Perl and the Python syntax.
18451845
.P
18461846
In PCRE2, a capture group can be named in one of three ways: (?<name>...) or
1847-
(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 32
1847+
(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 128
18481848
code units long. When PCRE2_UTF is not set, they may contain only ASCII
18491849
alphanumeric characters and underscores, but must start with a non-digit. When
18501850
PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
@@ -3889,6 +3889,6 @@ Cambridge, England.
38893889
.rs
38903890
.sp
38913891
.nf
3892-
Last updated: 19 January 2024
3892+
Last updated: 11 March 2024
38933893
Copyright (c) 1997-2024 University of Cambridge.
38943894
.fi

testdata/testinput10

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,11 @@
487487

488488
# Check name length with non-ASCII characters
489489

490-
/(?'ABáC678901234567890123456789012'...)/utf
490+
/(?'ABáC678901234567890123456789012012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
491491

492-
/(?'ABáC6789012345678901234567890123'...)/utf
492+
/(?'ABáC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
493493

494-
/(?'ABZC6789012345678901234567890123'...)/utf
494+
/(?'ABZC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
495495

496496
/(?(n/utf
497497

testdata/testinput2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,9 +4680,9 @@ B)x/alt_verbnames,mark
46804680
/(?<=\K.)/g,replace=-,allow_lookaround_bsk
46814681
ab
46824682

4683-
/(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
4683+
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFGH'toolong)/
46844684

4685-
/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
4685+
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFG'justright)/
46864686

46874687
# These two use zero-termination
46884688
/abcd/max_pattern_length=3
@@ -4949,7 +4949,7 @@ a)"xI
49494949
/{�̈́�̈́�{'{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
49504950

49514951
//
4952-
\=get=i00000000000000000000000000000000
4952+
\=get=i00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
49534953
\=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
49544954

49554955
"(?(?C))"

testdata/testoutput10

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,12 +1615,12 @@ No match
16151615

16161616
# Check name length with non-ASCII characters
16171617

1618-
/(?'ABáC678901234567890123456789012'...)/utf
1618+
/(?'ABáC678901234567890123456789012012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
16191619

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

1623-
/(?'ABZC6789012345678901234567890123'...)/utf
1623+
/(?'ABZC6789012345678901234567890123012345678901234567890123456789AB012345678901234567890123456789AB012345678901234567890123456789AB'...)/utf
16241624

16251625
/(?(n/utf
16261626
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)

testdata/testoutput2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14935,10 +14935,10 @@ Failed: error -60: match with end before start or start moved backwards is not s
1493514935
ab
1493614936
Failed: error -60: match with end before start or start moved backwards is not supported
1493714937

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

14941-
/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
14941+
/(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFG'justright)/
1494214942

1494314943
# These two use zero-termination
1494414944
/abcd/max_pattern_length=3
@@ -15549,7 +15549,7 @@ Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed,
1554915549
/{�̈́�̈́�{'{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
1555015550

1555115551
//
15552-
\=get=i00000000000000000000000000000000
15552+
\=get=i00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1555315553
** Group name in 'get' is too long
1555415554
\=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
1555515555
** Too many characters in named 'get' modifiers

0 commit comments

Comments
 (0)