regex_capture function

Capture regex groups