[]RSS

About Archives Artwork Comic Contact Philosophy Projects Tags

Mining For Expressions

November 11th, 2005 in Perl. Weblog

I always forget a few things about . 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, tools allow me to easily find nuggets of previous knowledge. Today’s exapmle:

find -name "*pl" -exec grep =~ {} \;
          1              2  3  4
  1. Look through all my old Perl scripts
  2. Search in the scripts
  3. Look for lines with regular expressions
  4. 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.

 

Leave a Reply

Subscribe to comments