Usually in our work, we use regular expressions in the operations of capture or matching.
However, regular expressions can be used - at least manually - to generate legal proposals that match the regular expression. Of course, some regular expressions may correspond to infinitely long sentences, for example, an expression .+ .
I have a problem that can be solved with a regular expression sentence generation algorithm.
In pseudocode, it will work something like this:
re = generate("foo(bar|baz)?", max_match = 100);
What algorithm will do this for me?
regex regular-language generative-programming
Paul nathan
source share