transfer regular expression into reverse expression