Skip to content

Commit 291e398

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 54a6582 commit 291e398

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
@@ -2881,9 +2881,19 @@ has since been undefined.
28812881
=item Group name must start with a non-digit word character in regex; marked by
28822882
S<<-- HERE> in m/%s/
28832883

2884-
(F) Group names must follow the rules for perl identifiers, meaning
2885-
they must start with a non-digit word character. A common cause of
2886-
this error is using (?&0) instead of (?0). See L<perlre>.
2884+
(F) Group names must follow the rules for Perl identifiers, meaning
2885+
they must start with a character that matches C<\p{XID_Start}> plus the
2886+
underscore. This means the first character may not be a digit.
2887+
Subsequent characters must match C<\p{XID_Continue}>.
2888+
2889+
A common cause of this error is using (?&0) instead of (?0).
2890+
2891+
This message was formulated before Perl supported Unicode; so it is
2892+
not accurate for Unicode characters outside the ASCII-range. There are
2893+
many word characters in Unicode that may not start a group name, and a
2894+
few that may not be a continuation character.
2895+
2896+
See L<perlre>.
28872897

28882898
=item ()-group starts with a count
28892899

0 commit comments

Comments
 (0)