Is there a way to get the PREMATCH ($`) and POSTMATCH ($') from pcrecpp?
- by Eric Peers
Is there a way to obtain the C++ equivalent of Perl's PREMATCH ($`) and POSTMATCH ($') from pcrecpp? I would be happy with a string, a char *, or pairs indices/startpos+length that point at this.
StringPiece seems like it might accomplish part of this, but I'm not certain how to get it.
in perl:
$_ = "Hello world";
if (/lo\s/) {
$pre = $`;…