Skip to content

loveyacper/toy-regex

Repository files navigation

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

🎁A toy-regex use follow set and DFA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published