A regular expression engine implementation in JavaScript. It supports concatenation, union (|), zero-or-more (*), one-or-more (+), and zero-or-one (?) operations as well as grouping. It follows Ken Thompson's algorithm for constructing an NFA from a regular expression.
Check out my blog post for the complete implementation details.
const { createMatcher } = require('./regex');
const match = createMatcher('(a|b)*c');
match('ac'); // true
match('abc'); // true
match('aabababbbc'); // true
match('aaaab'); // false
git clone https://github.com/deniskyashif/regexjs.git
cd regexjs
npm i
npm start
npm t