RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find To validate the File Type for a FileUploader
Expression
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$
Description
You can use this to check the valid file type you have given to the last in the expression like ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$ This will accept .pdf only OR ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+((.pdf)|(.doc))$ This will accept .pdf and .doc OR ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+((.pdf)|(.doc)|(.txt))$ This will accept .pdf , .doc and .txt
Matches
C:\Documents and Settings\chandan.kumar\Desktop\1004.pdf
Non-Matches
C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg
Author Rating: The rating for this expression. Chandan Kumar
Source CAHNDAN KUMAR
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: feed back
Name: samatha
Date: 9/8/2008 7:08:32 AM
Comment:
this is good,but it will work only in IE,but not supporting for opera,firefox browsers,pls check it once...thank you


Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials