3 ms·
I was under the impression that Go's regex library was RE2. Wasn't RE2 originally written by Russ Cox?
by eridius 8y ago
I was under the impression that Go's regex library was RE2. Wasn't RE2 originally written by Russ Cox?
- burntsushi 8y agoRE2 is written in C++. Go's regex library is written in pure Go. Russ Cox wrote both of them. Both RE2 and Go's regex library have a Pike VM, a bitstate backtracker, and a one-pass NFA, but RE2 has a lazy DFA which Go lacks. The lazy DFA is a key component for performance in a lot of cases.
- SiVal 8y agoAny idea why Cox left it out? Is it just a "we intend to add it but haven't gotten to it yet" or "we don't want it because..."?
- burntsushi 8y agoI don't know specifically, but I'd guess the former over the latter. Adding a lazy DFA is a lot of work. There is an issue tracking the addition of a lazy DFA on the golang tracker. My guess is that it's up to a contributor to do it.