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

I think he should have attributed more importance to regular expressions. They don't even get mentioned, beyond being implied by grep.


You can grep for regular expressions? I think my mind just got blown. For the last ten years I've been finding them with awk.

awk '(/putithere/) {print $0}'


http://en.wikipedia.org/wiki/Grep

grep is a command line text search utility originally written for Unix. The name is taken from the first letters in global / regular expression / print, a series of instructions for the ed text editor.

grep -rHnE 'my [r]eg+ex' /path/to/folder/ : look for files with this regular expression recursively and print out their name and the line number, as well as the matching line itself.

Awk might do it, or you can -exec it with find, but I've read several times that grep is generally faster, even faster than a simple search with a custom and non-optimized C program.


The re in grep means "regular expression".




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: