[pcre-dev] [Bug 1679] Ability to explicitly specify what to …

Página Inicial
Delete this message
Autor: admin
Data:  
Para: pcre-dev
Assunto: [pcre-dev] [Bug 1679] Ability to explicitly specify what to capture (feature request)
https://bugs.exim.org/show_bug.cgi?id=1679

--- Comment #4 from Philip Hazel <ph10@???> ---
Currently, pcre2_substitute() gives access only to captured substrings in the
replacement string. It would be possible to allow it to access the MARK string,
in which case you could do something similar to Perl. The syntax ${*mark}
(which currently causes an error) could be used. Only one MARK name is
available, of course. In pcre2test you could then write

/(*MARK:pear)apple|(*MARK:strawberry)cherry/g,replace=${*mark}

for example. This would be implemented by calling pcre2_substitute() with the
PCRE2_SUBSTITUTE_GLOBAL option. The code for this should be straighforward and
might be generally useful, so I'll implement it and see how it feels.

--
You are receiving this mail because:
You are on the CC list for the bug.