remove extraneous capturing groups from regexs