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

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

Thread Next
Teresa Raymond
April 1, 2002 07:57
regex excluding \w.\w\w\w.\w
Message ID:
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               -
- -

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About