An NFA-based regex engine with a library and command-line tool.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Aadhavan Srinivasan a631fc289c Clone 'isBackreference' and 'referredGroup' NFA fields, because they aren't thread variables 2 weeks ago
cmd Change when a newline is printed; so that we don't print extraneous newlinesraneous newlines 3 weeks ago
regex Clone 'isBackreference' and 'referredGroup' NFA fields, because they aren't thread variables 2 weeks ago
.gitignore Added gitignore 5 months ago
LICENSE Updated license 1 month ago
Makefile Disable all optimizations 1 month ago
README.md Updated README 3 weeks ago
go.mod Updated module name to 'kleingrep' (Let's goo!) 1 month ago
go.sum Print matched content in color 5 months ago

README.md

Kleingrep

Kleingrep is a regular expression engine, providing a library and command-line tool written in Go.

It aims to provide a more featureful engine, compared to the one in Go's regexp, while retaining some semblance of efficiency.

The engine does not use backtracking, relying on the NFA-based method described in Russ Cox's articles. As such, it is immune to catastrophic backtracking.

It also includes features not present in regexp, such as lookarounds and backreferences.

Syntax

The syntax is, for the most part, a superset of Go's regexp. A full overview of the syntax can be found here.

For more information, see https://pkg.go.dev/gitea.twomorecents.org/Rockingcool/kleingrep/regex.