Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 715 Bytes

README.md

File metadata and controls

19 lines (13 loc) · 715 Bytes

regex-derivatives

Simple regex engine written in Haskell.

Instead of using backtracking or finite automata to match strings, it uses derivatives. The idea and algorithm are taken from a blog post by Matt Might.

Installation

git clone https://github.com/dwnusbaum/regex-derivatives.git
cd regex-derivatives
cabal update && cabal install

Use

regex '[abc]*d?' '123aaacbccbd'
regex 'Str..' "$(cat ./Main.hs)"

The output is colored like the output of ag.