[sf-lug] regular expressions: match 1 to 4 char word; does . match etc.

Asheesh Laroia asheesh at asheesh.org
Sun Dec 14 18:12:12 PST 2008


On Sun, 14 Dec 2008, Jesse Zbikowski wrote:

> Forget about the regular expression capabilities in the standard Unix 
> commands unless you are a masochist.

Or (my preference) get used to demand "E"xtended regular expressions.

$ grep -E

$ sed -r

Those two give you a perl-ish modern set of regular expressions where you 
don't find yourself cursing the tool for being stuck in 1988.  It's 
probably not "full" perl-compatible regular expressions, but I've always 
been happy with how close it is.

I firmly believe we need to stop teaching "grep and sed" and start 
teaching people to use "grep -E and sed -r".

-- Asheesh.

-- 
People are beginning to notice you.  Try dressing before you leave the house.




More information about the sf-lug mailing list