RXPY is a free and open source pure-Python regular expression library, compatible with the re package.
RXPY can be used as a test-bed for new matching algorithms - the parser and compatibility components are reusable.
RXPY has a modular design that allows different alphabets and engines to be used. This allows regular expressions to be defined over sequences of arbitrary objects (a mapping between objects and the characters used in the regular expression must exist; this is defined by the alphabet).
Here are some key features of "RXPY":
Alphabets:
· RXPY includes the concept of "alphabets". These let you define a regular expression for types other than strings. The initial code includes a proof-of-concept that matches lists of integer digits.
Engines:
· RXPY allows different engines to be used during matching. The initial code includes a simple, recursive matcher, but the aim is to eventually support a DFA-based matcher, modelled on re2.
Graph:
· The regular expression is represented internally as a graph, parameterised by the alphabet and interpreted by the engine.