Pcrecpp functions do not appear to directly support extraction by
named subpattern (there are pcre functions for get_named_substring and
copy_named_substring)
It would be nice if we would be able to do things like this:
local first second third
static mydayvar
re.create("(?P<monthvar>\w{3}) (?P<dayvar>\d{1,2}),
(?P<yearvar\d{4})").;;+
fullmatch("Dec 16,2006","first", "second", "third"))
mydayvar=re.getnamed(dayvar)
;where mydayvar would magicly be 16 (having autoretrieved the second
;subpattern)
Just a thought in case it might be in the cards at some stage. It
allows you to get a substring without worrying about where it is.
It would also be nice if some number of subpatterns were preallocated
and didn't need to be specified. In php you get $1, $2, etc. plus $0
for the entire matched string.
Regards,
Sheri