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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^([a-zA-Z]\:|\\)\\([^\\]+\\)*[^\/:*?"<>|]+\.htm(l)?$
Description
Validates a file path on your local drive or a network drive. A similar one was written by Vinod Kumar but it does not reject asterisks in the path. Moreover, his did not work with RegularExpressionValidators. This one does.
Matches
x:\test\testing.htm | x:\test\test#$ ing.html | \\test\testing.html
Non-Matches
x:\test\test/ing.htm | x:\test\test*.htm | \\test?&lt;.htm
Author Rating: Not yet rated. asdf asdfa
Source http://groups.google.com/groups?hl=en&amp;amp;amp;lr=&amp;amp;amp;ie=UTF-8&amp;amp;amp;oe=UTF-8&amp;amp;amp;threadm=d2d855ea.020423144
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: File Name
Name: Roberto Misticoni e Girolamo Di Cola
Date: 10/28/2003 9:26:36 AM
Comment:
This regular expression fails e.g. c:\\ because it match. this is our idea: ^([a-zA-Z]\:|\\\\[^\/\\:*?"<>|]+)(\\[^\/\\:*?"<>|]+)+(\.[^\/\\:*?"<>|]+)$ Roberto Misticoni Girolamo Di Cola


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