rewrite regular exp