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

The name "grep" is unrelated to GNU. According to The Jargon File, the etymology is:

from the qed/ed editor idiom g/re/p, where re stands for a regular expression, to Globally search for the Regular Expression and Print the lines containing matches to it

In fact, grep predates the GNU project by almost a decade.

Also, it's the first time I hear about "GNU" regexps.




Thanks, just learned something new. grep predates GNU by about a decade it seems.


a more accurate term would be "BRE with GNU extensions", e.g. \(\)


\(\) are part of BRE syntax. They are not GNU extensions.

Source: http://pubs.opengroup.org/onlinepubs/7908799/xbd/re.html#tag...


er, I meant \{\}.


\{n\}, \{n,\} and \{n,m\} are all in POSIX.

\{,m\} is a (pretty obscure) GNU extensions.


hm, I could've sworn it wasn't. http://www.regular-expressions.info/gnu.html says that \?, \+, and \| are GNU extensions though.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: