Title |
Test
Find
Detect zip files
|
Expression |
^([a-zA-z]:((\\([-*\.*\w+\s+\d+]+)|(\w+)\\)+)(\w+.zip)|(\w+.ZIP))$ |
Description |
I used this regex to check to make sure the file type being uploaded through an input tag was a zip file. Changing the '.zip' to another extension will change the file extension being verified. |
Matches |
C:\Downloads\AtlasPlayground.zip | C:\Documents and Settings\name\My Documents\Asdfasdfasdf.zip | Z:\Program Files\asdf\a.d.f.controlsQ1 23213\NET1\LiveExamplesCS.zip |
Non-Matches |
Z:\Downloads\A@#@tlasPlayground.zip | AtlasPlayground.zip |
Author |
Rating:
Not yet rated.
alex
|
Source |
|
Your Rating |
|
Title: incorrect
Name: M.R.
Date: 11/4/2010 4:34:14 PM
Comment:
It validates zipTest.exe as well....
Title: pierpaolo
Name: vffv
Date: 9/4/2007 6:43:25 AM
Comment:
good
Title: Doesnt validate the . in front of the word zip
Name: Cammy
Date: 11/15/2006 3:54:35 AM
Comment:
Hi, this can pass through your regexp... both "test.zip" and "testzip" (without the '.' )
Title: Not working...
Name: Frank
Date: 8/25/2006 2:35:21 PM
Comment:
Hello, I'm trying to use this to validate an zip file upload, and it isn't working. Although, I can't say it is your regex, so I'm not going to down rate it.
I'm trying to use it with ASP.NET's validators. Any suggestions or thoughts?