Inverse regex?

Andrew Henshaw ahenshawatapowerdotcom
Sat Jul 7 04:49:17 CEST 2001

Has anybody seen or developed what might be called an inverse regex
generator.  We would like to do some unit testing of modules that have user
input validated by regular expressions.  It would be nice to throw some some
strings at them and see if the propagated input causes an error in the code
downstream.  In other words, it may help to detect if our validation
routines are insufficient.

I understand that, in many cases, a complete list of valid strings is
impossible.  However, for certain regular expressions it would be certainly
reasonable.  For others, it will be possible, but practically impossible
(set too large).  For the impossible, and near impossible, it would be nice
to generate a bounded set that hits many of the degenerate and extreme

Any ideas?

Andrew Henshaw

More information about the Python-list mailing list