|Generating strings from regular expressions firstname.lastname@example.org (KSG) (1999-05-24)|
|Re: Generating strings from regular expressions Helmut.Richter@lrz-muenchen.de (1999-05-27)|
|Re: Generating strings from regular expressions email@example.com (Jonathan Barker) (1999-05-27)|
|Re: Generating strings from regular expressions firstname.lastname@example.org (Carsten Fritz) (1999-05-27)|
|Re: Generating strings from regular expressions email@example.com (1999-05-27)|
|Date:||24 May 1999 01:40:10 -0400|
|Keywords:||lex, question, comment|
Does anyone know of any code or an algorithm that does the following:
input: a regular expression, R, and an integer k.
output: a list of all strings of length k that are in R
I've thought about building the NFA and traversing that, but I'm not
sure if building the NFA is really necessary. Is there a simpler way?
[Simpler? Sure. Enumerate all the strings of length k, run them through
the RE matcher of your choice, and list the one that match. But I will
admit that for large k it could be kind of slow. -John]
Return to the
Search the comp.compilers archives again.