Closed NWilson closed 2 months ago
Thanks for picking this up. The increase of group names from 32 to 128 happened for release 10.44, and obviously I forgot to do it in the substitute function.
I've made one minor change, to get rid of a "mixed code and declaration" warning. The style of PCRE2 code is not to mix code and declarations, except for a declaration inside an "if".
pcre2_substitute()
was only allowing 32-character names/utf
, capture group names can contain non-ASCII characters, butpcre2_substitute()
was allowing ASCII names onlyThe new function
read_name()
takes a silly number of lines of code given what it does, but I wanted it to match visually as closely as possible with the corresponding function inpcre2_compile.c
.Note that we don't allow SPACE and HT inside
${name}
replacements, even though Perl does. I have kept this unchanged. I have no opinion or desire to add more whitespace skipping.