What is the easiest way to determine the list of all strings up to length N accepted by DFA or regular expression?

193 Views Asked by At

For example I have the next simple regular expression: (11|0)+

It is clear that size of the set of strings that match with this regular expression is infinite: 011,110,11011, 11011011...

The size of a set of all binary strings with length less then or equal 8 is N=2^8+2^7... How to determine the size of subset of the strings that match with provided regular expression? How to get all these strings?

What is the general algorithm for any regular expression / DFA to determine such subset?