Skip to content

Tobulus/Regulus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Regulus- Matching regular expressions in linear time

Implements the basic ideas described by Russ Cox which basically uses Thompson's Construction to generate a non-deterministic finite automaton. The generated NFA can be used to match strings against a regex in linear time.

This is mainly for educational purposes. If you are searching for a production ready regex engine which doesn't use backtracking, check out google's re2.

Currently supported

  • Quantifiers: "*", "+", "?", "{3,4}"
  • Character classes: "[abc]", "[^abc]"
  • Ranges: "[a-z]"
  • Metacharacters: "\d", "\s", ...
  • Grouping: "(abc)*"
  • Alternation: "a|b"
  • Wildcard: "."

TODO

  • Group extraction
  • ...

About

Regular expressions in linear time

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages