About Rexpy

Rexpy is an open-source Python library for finding regular expressions from a corpus of example strings. It is part of the test-driven data analysis (tdda) repository on Github. You can read more about the motivation for Rexpy on the TDDA Blog.
This web application is a thin wrapper around the Rexpy library. It allows you to type (or paste) a number of example strings into the left-hand box (one string per line). When you click Find Patterns, Rexpy will attempt to find one or more regular expressions which, between them, match all the strings you provide. The goal is for the regular expressions to be general enough to capture all the likely variation in patterns if you have provided only a subset, while being specific enough to be useful.

Example

Input Strings Output
1-AB-987 \d+\-[A-Z]{2}\-\d{3}
1987-CD-321
23-ZQ-422
Here, the three input patterns all

Controls

There are two toggles that control the output. These can be set before or after generating the regular expressions.

Known Limitations

This is a demonstrator for Rexpy, which is a very young project. Rexpy itself has many limitations, some of which we hope to relax over time. Some of the more notable limitation are In addition to these limitations, we have limited the input for the Rexpy web application to: If you need more than this, you might want to run Rexpy locally. (Rexpy itself can handle millions of lines quite comfortably.)