my task is to do the following:
I have an alphabet consisting of 0 and 1 and a regular expression, for example: 1*(011+)1. Now I shall find all words of the language that have the length 0 - 4 and fit the regular expression. So the output would be: "","1","11","011","111" ... etc.
I should not give a list of words or numbers as a parameter, but the method should generate all these words by itself. Is there a function or method in the re. module which does exactly that?
Aucun commentaire:
Enregistrer un commentaire