diff --git a/regcomp.c b/regcomp.c index 774311f12d..c6a2e6ee0e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2533,8 +2533,8 @@ S_reg_scan_name(pTHX_ RExC_state_t *pRExC_state, U32 flags) && (advance = isWORDCHAR_utf8_safe( (U8 *) RExC_parse, (U8 *) RExC_end))); } else { - RExC_parse_inc_by(1); /* so the <- from the vFAIL is after the offending - character */ + /* so the <- from the vFAIL is after the offending character */ + RExC_parse_inc_safe(); vFAIL("Group name must start with a non-digit word character"); } sv_name = newSVpvn_flags(name_start, (int)(RExC_parse - name_start), diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t index a7662e9ce0..676843fb16 100644 --- a/t/re/reg_mesg.t +++ b/t/re/reg_mesg.t @@ -547,6 +547,7 @@ my @death_utf8 = mark_as_utf8( '/[\cネ]/' => "Character following \"\\c\" must be printable ASCII {#} m/[\\cネ{#}]/", '/\b{ネ}/' => "'ネ' is an unknown bound type {#} m/\\b{ネ{#}}/", '/\B{ネ}/' => "'ネ' is an unknown bound type {#} m/\\B{ネ{#}}/", + '/ネ(?<‿name>match)ネ/; #no latin1' => 'Group name must start with a non-digit word character {#} m/ネ(?<‿{#}name>match)ネ/', ); push @death, @death_utf8;