in reply to Getting File Type using Regular Expressions

Welcome to the wonderful world of regexes! To learn more about regular expressions, check out my perlrequick tutorial.

With reference to your particular question, alternation will help here:

if ($filename =~ /\.(jpg|gif|bmp|doc|txt)$/ { print "Found a match\n"; }

-Mark

Replies are listed 'Best First'.
Re: Re: Getting File Type using Regular Expressions
by bkiahg (Pilgrim) on Apr 21, 2004 at 13:36 UTC
    Thanks for the online tutorials guys. Will definitely read up on them.