SimpleRegex

About

SimpleRegex is a VERY simple regex library  I created in Haskell.  The purpose of the project was so that I could become more proficient in Haskell and functional programming, as well as learn how to parse and execute regular expressions.  The program defines a library called SimpleRegex which has two operators: =~ ( a greedy match) and =~? (a non greedy match).  This source code is a good example of how to turn a regex string into an NFA using Thompson construction, convert an NFA to DFA using epsilon closures and run a DFA on input strings.

SimpleRegex only supports the | (or), * (closure) and concatenation operators.

Features

  1. Converts Regex to NFA
  2. Converts NFA to DFA
  3. Executes DFA in a greedy or non-greedy manner.

Download

SimpleRegex

You can find the source code on github.

Screenshot
simpleregex

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>