rewrite regex, update/add tests