Aadhavan Srinivasan 360bdc8e11 Big rewrite - assertion handling, zero-match fixes, change in recursive calls
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.
2024-10-31 17:06:32 -04:00
2024-10-22 14:35:36 -04:00
2024-10-23 10:26:50 -04:00
2024-10-22 21:02:09 -04:00
2024-10-22 14:35:16 -04:00
2024-10-31 16:47:59 -04:00
2024-10-29 10:08:41 -04:00
Description
An NFA-based regex engine with a library and command-line tool.
2.5 MiB
Languages
Go 75.7%
Python 24.2%
Makefile 0.1%