remove non-capture from regex groups