Rewrite the regular expression.