regex cleanup, sub matches fix