develooper Front page | perl.beginners | Postings from April 2002

regex excluding \w.\w\w\w.\w

Thread Next
From:
Teresa Raymond
Date:
April 1, 2002 07:57
Subject:
regex excluding \w.\w\w\w.\w
Message ID:
p05100300b8ce31806e30@[67.36.183.220]
I'm trying to figure out how to exclude upload files with 2 periods 
at the end (b/c of that virus which I forgot the name of, maybe 
nimba?)  Anyhow, this is what I have but it doesn't work.  When I try 
to submit with the double periods the test always results in false 
and never gives the error msg.

if ($filename=~/(\w.\w\w\w.\w)$/)
{error($q, "Invalid file name; files must only contain one period.
Please push the back button on your browser and try again.");
}

-- 
-------------------------------
-  Teresa Raymond             -
-  Mariposa Net               -
-  http://www.mariposanet.com -
-------------------------------

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About