regular expressions

sinck@ugive.com sinck@ugive.com
Tue, 20 Feb 2001 07:55:06 -0700


\_ --- simple-grep.c ---
\_ [50 lines of C]
\_ --- end simple-grep.c ---
\_ 
\_ By way of comparison the above C program is roughly comparable to the
\_ following perl program:
\_ 
\_ --- simple-grep.pl ---
\_ [8 lines of Perl]
\_ --- end simple-grep.pl ---
\_ 
\_ Actually, the perl solution is superior [....]

Don't overlook it being superior by way of being shorter.  A rough
guess would say that there's about 10x the amount of typing for the C
program.  Plus smaller code tends to be simpler to understand.

This is not to say that C doesn't have it's place.  It's a matter of
using the best tool....

David
ps: C's place is properly between 'B' and 'D'; just ask my
youngsters.  :-)