Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Some 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



This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: