[sf-lug] regular expressions: match 1 to 4 char word; does . match etc.
Jesse Zbikowski
embeddedlinuxguy at gmail.com
Sun Dec 14 16:15:28 PST 2008
On Sun, Dec 14, 2008 at 1:10 PM, Michael Paoli
<Michael.Paoli at cal.berkeley.edu> wrote:
> Although the "standard" Unix
> regular expression stuff is quite powerful, for the really hairy stuff,
> perl's regular expression - and other - capabilities, may be much more
> suitable
I agree with this and I would further suggest to learn one regular
expression syntax (e.g. Perl's) and stick with it. If you try to
write command lines mixing RE syntax from grep, egrep, find, sed, etc,
you are going to end up making mistakes. You forget where . means
"any character" and where it is a literal, when you glob with * and
when you need .*, etc etc etc. Get used to piping your commands to
perl -ne, or whatever is the equivalent in Python / Ruby / your
favorite glue language. Forget about the regular expression
capabilities in the standard Unix commands unless you are a masochist.
More information about the sf-lug
mailing list