Go helper for saving regular expression capture groups.