Mining For Expressions
I always forget a few things about Perl regular expressions. Regexes are a large specification, I only ever use a portion of it at any one time, and I’m forgetful (there’s just too much to remember all at once).
Luckily, unix tools allow me to easily find nuggets of previous knowledge. Today’s exapmle:
find -name "*pl" -exec grep =~ {} \;
1 2 3 4
- Look through all my old Perl scripts
- Search in the scripts
- Look for lines with regular expressions
- In the files we found
In the five seconds it takes me to type the find command , I have a full list of thousands of regular expressions. I can forget most of what I know, as long as what I’ve done is stored in text on a system with good text tools.

RSS