Looking for a regexp generator based on a set of known string representative of a string set

Ant antroy at gmail.com
Fri Sep 8 17:55:28 CEST 2006

vbfoobar at gmail.com wrote:
> Hello
> I am looking for python code that takes as input a list of strings
> (most similar,
> but not necessarily, and rather short: say not longer than 50 chars)
> and that computes and outputs the python regular expression that
> matches
> these string values (not necessarily strictly, perhaps the code is able
> to determine
> patterns, i.e. families of strings...).
> Thanks for any idea

def getRegex(list_of_strings):
   return ".*"


More information about the Python-list mailing list