Skip to content

ysharplanguage/regexjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regexjs

Build Status

A regular expression engine implementation in JavaScript. It supports concatenation, union (|) and closure (*) 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.

Example

const { createMatcher } = require('./regex');
const match = createMatcher('(a|b)*c');

match('ac'); // true
match('abc'); // true
match('aabababbbc'); // true
match('aaaab'); // false

Try It

git clone https://github.com/deniskyashif/regexjs.git
cd regexjs
npm i
npm start

Run the tests

npm t

About

A fast and minimal regular expression engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.1%
  • Java 23.6%
  • ANTLR 0.3%