360bdc8e112558ec352059e9ae135a993d8fcbc7
I added support for transitions. I wrote a function to determine if a given state has transitions for a character at a given point in the string. This helps me check if the current state has an assertion, and take actions based on that. I also fixed zero-length matching (almost, see todo.txt). It works for nearly all cases I could think of, although I still need to write more tests. I wrote a function to check if zero-length matches are possible with a given state. I also changed the way recursive calls work. Rather than passing a modified string, the function stores the location in the input string. This location is updated with each call to the function. Finally, the function now increments the offset by 1 instead of incrementing by the length of the longest match. This leads to a bit of overhead eg. if a regex matches index 1-5, then 1-5, 2-5, 3-5, 4-5 are all stored. To fix this, I wrote (and used) a function to check if a match overlaps with any matches in a slice.
Description
An NFA-based regex engine with a library and command-line tool.
Languages
Go
75.7%
Python
24.2%
Makefile
0.1%