simplify regexp match parsing using non-matching groups