Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Not equal, regular expressions

by RMGir (Prior)
on Jun 25, 2002 at 15:43 UTC ( #177117=note: print w/ replies, xml ) Need Help??


in reply to Not equal, regular expressions

Right.

Assume the parameter is "mike.txt". Then the regex will match for .txt, but fail for .htm and .html, so the error will get printed twice.

If the parameter doesn't match any of those patterns, the error gets printed 3 times.

You're also not checking to make sure the extension is at the end of the filename, so that would match "miketxt.exe" as well, since /.txt/ is "any character, followed by 'txt'".

Please check out this discouraging webpage to get some other ideas of ways your script could possibly be abused...
--
Mike


Comment on Re: Not equal, regular expressions

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://177117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-12-21 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls