Rewrite regex.