Automating the process of regular expressions generation