Fixed match-re capturing the entire string when an optional subcapture doesn't match.