beating back the microsoftian hordes...

Andrew Savige ajsavige at
Wed Nov 19 05:41:47 CST 2003

peter renshaw wrote:
> was this before or after they (Gosling and Java engineers at Sun) tried 
> some regular expression hacks in competition with some Perl hackers?

A wise man once analysed this problem:

egrep -v '\.(gif|GIF|jpg|JPG|css|CSS) HTTP|^192\.(9|18|29)\.' inf >e

gawk '!/\.(gif|GIF|jpg|JPG|css|CSS) HTTP|^192\.(9|18|29)\./{print}' inf >a

perl -ne'/^192\.(?:9|18|29)\./||/\.(?:gif|GIF|jpg|JPG|css|CSS) HTTP/ or
print' inf >p

Apart from being 100 times shorter than the given Java solution, all
three solutions are *much* faster (alas, egrep beat Perl for both golf
and speed on this one). But hey, the Java web site *still* claims that
Java beat Perl on this problem, so that must be right. ;-)

/-\ - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

More information about the Melbourne-pm mailing list