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
File Name Validator. Validates both UNC (\\server\share\file) and regular MS path (c:\file).
Matches
File.txt | c:\Blah\..\.\Blah Blah.Blah\File.txt | \\server\share\file.txt
Non-Matches
File.txt | c:\.File.txt | c:\.\.Blah\File.txt
Author Rating: The rating for this expression. Dmitry Borysov
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: Does not match file names starting with point
Name: Markus Heinrichs
Date: 10/25/2006 8:33:00 AM
Comment:
C:\.test.txt does not match.


Title: What about different operating systems?
Name: Adrian
Date: 6/16/2006 3:18:37 AM
Comment:
Hi all, isn't there a difference for what operating system the file name should be validated? I'm myself not sure about this, so sorry if this question is obsolet.


Title: aaa
Name: aa
Date: 10/10/2005 8:18:19 PM
Comment:
^(([a-zA-Z]:|\\)\\)?(((\.)|(\.\.)|([^\\/:\*\?"\|<>\. ](([^\\/:\*\?"\|<>\. ])|([^\\/:\*\?"\|<>]*[^\\/:\*\?"\|<>\. ]))?))\\)*[^\\/:\*\?"\|<>\. ](([^\\/:\*\?"\|<>\. ])|([^\\/:\*\?"\|<>]*[^\\/:\*\?"\|<>\. ]))?$


Title: Not mathing ROOT MS folder
Name: Joseph Higaki
Date: 12/3/2003 5:03:41 PM
Comment:
this reg xpression is not matching C:please, what should i change to make this pattern match the string above


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