Hacker News new | ask | show | jobs
by eru 1012 days ago
Though going from NFA to explicit DFA isn't always a good idea.

Btw, you might also like looking into the Brzozowski derivative https://en.wikipedia.org/wiki/Brzozowski_derivative which can be used as an alternative way to match regular expressions.

2 comments

I think it is also worth mentioning that the site linked at the top uses the antimirov extension to brzozovzki work on regex deivatives.
To expand, Brzozowski introduced derivatives and Antimirov partial derivatives. Essentially the former correspond to DFAs and the latter to NFAs.
You could implement the NFA directly with concurrent exploration of all paths:

https://github.com/mike-french/myrex