implemented regular expression history