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

Andy Dingley dingbat at codesmiths.com
Fri Sep 8 11:55:37 EDT 2006


vbfoobar at gmail.com wrote:

> I am looking for python code that takes as input a list of strings
> [...] and outputs the python regular expression

    (s1|s2|s3|s4|s5)
for strings of "s1" etc.

Regex compilers are themselves quite good at optimising beyond this




More information about the Python-list mailing list