ok puting each and every
int pos = 0; pos < re.captureCount(); ++pos
as
int pos = 0; pos <= re.captureCount(); ++pos
I have the output:
with regex: %(.*)%
%foo%
foo
with regex: \%(.*)\%
%foo%
foo
with regex: %([^%])%
with regex: \%([^\%])\%
with regex: \x25([^\x25])\x25
with regex: \%(.*)\%
%foo%
foo
The cap(0) matches the whole expression apparently