Skip to content

Instantly share code, notes, and snippets.

View DelusionalLogic's full-sized avatar

Jesper Jensen DelusionalLogic

View GitHub Profile
@taylor
taylor / regexnfaparser.py
Created December 9, 2011 18:18
python regex to (simple) NFA parsing code
"""
From: https://github.com/darius/sketchbook/blob/master/regex/integrated1.py
Integrate the right-to-left top-down operator-precedence parser with
the simplest terminating NFA code.
"""
def match(re, s): return run(prepare(re), s)
def run(states, s):