The aim of this project is to create a regular expression engine using Thompson's construction
Note: This is a personal educational project and is not meant to be used inside a production environment.
At the current stage in development, the engine converts each regex expression into its corresponding non deterministic finite automata and supports only text directed matching.
- Regex-directed matching features, such as look back and capture groups.
There are three empty folders: lib
, bin
and include
which are populated
by Make install
.
To build to project, from the project root directory run the following commands:
> rm -rf build && mkdir build
> git submodule init && git submodule update
> cd build
> cmake ...
> make && make install
or you can run the script build.sh to execute a clean build.
Currently we have the class NDFA
which a converts a regular expression to an automata
by passing the regular expression as an argument:
std::string regex = "a*|a*b"
NDFA corrosponding_automata{regex};
std::string text1 {"aaaaaaaa"};
std::string text2 {"aaaaaaaab"};
std::string text3 {"bb"};
std::cout << corrosponding_automata.match(text); // prints true
std::cout << corrosponding_automata.match(text); // prints true
std::cout << corrosponding_automata.match(text3) // prints false