Regex: Handle nested groups