generates regular expressions based on test cases