Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Regex Parser?

This is all based on Russ Cox' paper about fast-matching regular expressions. It's a neat paper, you should check it out.

So Ruby regexes are slow?

Look in the notes folder to see my evidence. It seems to bear out Russ Cox' point. So yes, it seems that in ruby, these kind of regexes are slow.

What's the goal?

It's all about playing with the ideas. There's no practical, useful plan. If that happens, that's awesome, but it'll be later.

What's it do so far?

Read the code, there's not much of it. But the idea is, you hand-roll a deterministic finite automata (see the Node class), and it has methods for matching a string (returns a boolean), and generating sample strings (by walking the finite automata).


  1. Implement a pattern parser & builder.
  2. Add non-literals to the patterns, so things like ., [0-9], and \d work.
  3. I made it support NFAs, but I should probably add more tests.