Welcome to the official development repository of RegexRiot!
Here is a direct link to the repository that contains both the project proposal and final report of the class project that led to the creation of RegexRiot.
This library is built around the interface RiotString
.
RiotString
s are immutable type objects that represent
a regex. They can have two types of operations done upon
them.
- combination: A
RiotString
can combine with anotherRiotString
to produce a newRiotString
that is the combination of its parentRiotString
s- 'abc' then 'xyz' => 'abcxyz'
- 'abc' or 'xyz' => 'abc|xyz'
- modification: A
RiotString
can be modified to create a new altered variant of the originalRiotString
- 'abc' times 3 => '(abc){3}'
- 'abc' but 'c' is optional => 'abc?'
There should be room to improve LazyRiotString evaluation speed by caching evaluated results. But that breaks the principal of immutability. Instead, the closest current thing is to use the eval method to create a new LazyRiotString that is the same regex but with all the nested prefixes and suffixes resolved to a single string regex