[boulder.pm] RegExpn Matching, not

Jay Kominek jay.kominek at colorado.edu
Wed Feb 9 17:03:52 CST 2000


> Defined when reading a config file:
> $ComicsMatch{userfriendly}= cartoons\/archives\/\w*\/\w*.gif;

I think you need your Perl license taken away for barewording that. :)

$ComicsMatch{'userfriendly'} = 'cartoons/archives/\w*/\w*.gif';

Is much nicer, but since I just noticed that somebody else responded
and I don't want my typing to go to waste, I'll point out a bit of
pedantry. :)

Your regexp above will match "cartoons/archives//!giflkjasdfljsadlfkjsadf"
Which, while a pathological case, probably isn't something you want.
Consider using the regexp 'cartoons/archives/\w+/\w+\.gif$', which is
less likely to match things you don't want.

- Jay Kominek <jay.kominek at colorado.edu>
  Hail Eris!




More information about the Boulder-pm mailing list