3 ms·
Adding lookbehinds to the regexp library is a terrible idea. > The regexp implementation provided by this package is guaranteed to run in time linear in the si
by patrec 7y ago
Adding lookbehinds to the regexp library is a terrible idea.
> The regexp implementation provided by this package is guaranteed to run in time linear in the size of the input.
Python's is exponential, because it inherits all the non-regular "regular" expression mess (such as lookbehind and backrefs) from perl.
One would assume esr would have marinated in unix culture for long enough to be aware of this.
- deleted 7y ago[deleted]
- wittekm 7y agoSome projects need performant regexes, and some honestly just don't. I agree that keeping the base regex library linear is admirable, but it's be nice if they offered a well-marked thing like regex.slow_and_perl_like in the stdlib
- patrec 7y agoThis would contravene the training-wheels nature of Go. Also, Perl-style (ir-)regular expressions, despite their popularity, are not a worthwhile abstraction IMO and thus should not be enshrined in the standard library of programming languages, even if you want them in your library eco-system for end-user facing API compatibility.
- alexhutcheson 7y agohttps://godoc.org/github.com/glenn-brown/golang-pkg-pcre/src/pkg/pcre https://godoc.org/github.com/glenn-brown/golang-pkg-pcre/src...