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

It actually effectively lost it a bit before. Perl did not invent regular expressions, in fact Larry Wall started with a package by http://en.wikipedia.org/wiki/Henry_Spencer that itself was a reimplementation of an API that appeared in AT&T's V8 Unix that was released in 1985 and was incorporated into standard Unix tools like egrep.

Perl standardized a good enough regular expression dialect that everyone else copied it. But the divergence between "regular expression" and "strictly only regular languages" was already a lost cause.



POSIX regular expressions (file glob patterns, BRE's and ERE's) have more features than regexes in old CS papers, but they are still regular: they compile to automata with no backtracking.


The ERE described in egrep(1) has backreferences which can match non-regular languages. Are you thinking of some other notion of ERE?


He is thinking of what POSIX specified, which does not have backreferences. See http://www.regular-expressions.info/posix.html for details.


Aha, I didn't know about the difference between POSIX ERE and GNU ERE. Thank you!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: