--- Comment #13 from Philip Hazel <Philip.Hazel@???> ---
I am not keen on pcre2test being used for anything other than testing PCRE2 and
one-off experimenting with patterns. It really isn't meant for any kind of
production use. Having said that, of course you are free to take the code and
do what you like with it, but it contains a lot of code for testing obscure
PCRE2 features, not to mention supporting 8, 16, and 32-bit testing. As for
replacing with an empty string, I first thought this was just something
unnecessary, but in fact I think you have found a bug which I have noted for
fixing. It should be possible to say replace=, to get an empty string - but
note that it is documented that there is no way to get a comma in a replacement
string. For testing purposes this doesn't matter.
pcre2grep does have the -O option, which does some of what you want in the way
of replacement, but is probably not general enough for you.
I am sure you would be better off writing a bespoke program to do what you
need. There is a demonstration program pcre2demo, but it just does matching,
not replacement, though it could be a start.
You are receiving this mail because:
You are on the CC list for the bug.
This message was posted to the following mailing lists: