Skip to content

Commit ba00806

Browse files
committed
perldiag: Update description for regex group names
This was written before Unicode, and its wording does not accurately extend beyond ASCII. This commit clarifies the description.
1 parent 6cc07d1 commit ba00806

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

pod/perldiag.pod

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2866,9 +2866,19 @@ has since been undefined.
28662866
=item Group name must start with a non-digit word character in regex; marked by
28672867
S<<-- HERE> in m/%s/
28682868

2869-
(F) Group names must follow the rules for perl identifiers, meaning
2870-
they must start with a non-digit word character. A common cause of
2871-
this error is using (?&0) instead of (?0). See L<perlre>.
2869+
(F) Group names must follow the rules for Perl identifiers, meaning
2870+
they must start with a character that matches C<\p{XID_Start}> plus the
2871+
underscore. This means the first character may not be a digit.
2872+
Subsequent characters must match C<\p{XID_Continue}>.
2873+
2874+
A common cause of this error is using (?&0) instead of (?0).
2875+
2876+
This message was formulated before Perl supported Unicode; so it is
2877+
not accurate for Unicode characters outside the ASCII-range. There are
2878+
many word characters in Unicode that may not start a group name, and a
2879+
few that may not be a continuation character.
2880+
2881+
See L<perlre>.
28722882

28732883
=item ()-group starts with a count
28742884

0 commit comments

Comments
 (0)