#!perl.exe -w

use strict;

my $filename = 'image.gif';
#my $filename = 'image.jpg';

if ($filename =~ m/^.*\.(jpg|gif)$/)
{
        print "Got one!";
}

---

hth

toby

-----Original Message-----
From: Troy May [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 3:58 PM
To: Perl Beginners
Subject: Regex help!


Please...  :)

Hello, I'm trying to match images by the extension.  Either .jpg or .gif

Here's what I wrote:

$plup =~ m/\(\^\.\.gif\|\^\.\.jpg)/\

Is it all screwed up?  I'm not real good with regexes.

Thanks if you can help me!

Troy

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to