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]\:|\\\\[^\/\\:*?"<>|]+\\[^\/\\:*?"<>|]+)(\\[^\/\\:*?"<>|]+)+(\.[^\/\\:*?"<>|]+)$
Description
This regular expression match any valid file path. It checks local drives and network path. The file extension is required.
Matches
c:\Test.txt | \\server\shared\Test.txt | \\server\shared\Test.t
Non-Matches
c:\Test | \\server\shared | \\server\shared\Test.?
Author Rating: The rating for this expression. Roberto Misticoni
Source
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: Problem with Spaces
Name: Rick
Date: 12/13/2009 5:48:44 PM
Comment:
This regular expression will not stop the entering of spaces at the end once the filename is specified, e.g.: "c:\windows\system32\ccm\logs\smstcno.log flkeflk eflkelfke efefef" will match.


Title: Not working
Name: Kristian
Date: 6/17/2009 4:47:39 AM
Comment:
Does not work for normal windows paths.


Title: Not working for the test Input
Name: Saibal
Date: 10/12/2006 3:08:33 AM
Comment:
The test sting that you have provided does not work with the Expression


Title: Regular Expression: File Path Pattern
Name: Pat Walker
Date: 9/28/2006 5:53:43 PM
Comment:
Is there an updated expression that will work in IE 7.0? It still does not seem to work.


Title: Does not work in IE 7.0
Name: Nitin Arora
Date: 2/15/2006 8:06:49 AM
Comment:
Hi, I have used this regular expression in my web site. Its not working in IE 7.0. Can you check and update the expression so that it supports IE 7.0. Thanks Nitin Arora


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