loveyacper / toy-regex

:gift:A toy-regex use follow set and DFA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toy-regex

A toy-regex use follow set and DFA, support () [^] | . * ? + concatenation.

example

Regex  r("a\\+[bc](.*)e?f+");

assert (r.Match("a+cbf"));
assert (r.Match("a+bceff"));

///
assert (r.Compile("x(a(b|c))*(d|e)"));

assert (r.Match("xabacd"));
assert (r.Match("xd"));

assert (!r.Match("xde"));

About

:gift:A toy-regex use follow set and DFA


Languages

Language:C++ 97.3%Language:CMake 2.5%Language:Makefile 0.3%