|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: ___cliff rayman___ (cliff
genwax.com)Date: Tue Oct 09 2001 - 17:22:11 CDT
Andrew Blogg wrote:
> ---snip---
>
> sub extcheck
> {
local $_;
chomp; #remove end of line on our local copy
# there may need to be some more cleanup here to
# make sure we have the filename and the filename only
>
> /.*.[Vv][Bb][Ss]/ && errormsg;
> /.*.[Cc][Oo][Mm]/ && errormsg;
> /.*.[Ee][Xx][Ee]/ && errormsg;
> /.*.[Cc][Hh][Mm]/ && errormsg;
> /.*.[Ss][Cc][Rr]/ && errormsg;
> /.*.[Hh][Tt][Aa]/ && errormsg;
> /.*.[Vv][Bb][Ee]/ && errormsg;
> /.*.[Ss][Hh][Ss]/ && errormsg;
> /.*.[Bb][Aa][Tt]/ && errormsg;
> };
i think these should be in the form of /.*\.vbs$/i && errormsg;
the \. means a period and not just any character
the $ at the end anchors the pattern at the end
the /i modifier is not that important, just clearer, since you do not have to
give an alternation for each character.
the regex's that you are using cause any filename that has at least
one character followed by any of those three characters to get a warning
message. so a filename of "welcome.gif" would get a warning message
because of the 'com' preceded by at least one character in the name.
-- ___cliff rayman___cliffgenwax.com___http://www.genwax.com/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]