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([A-Za-z0-9'~`!@#$%&^_+=\(\){},\-\[\]\;])+?([ A-Za-z0-9'~` !@#$%&^_+=\(\){},\-\[\];]|([.]))*?(?(3)(([ A-Za-z0-9'~`!@#$ %&^_+=\(\){},\-\[\]\;]*?)([A-Za-z0-9'~`!@#$%&^_+=\(\){},\-\[ \];])+\z)|(\z))
Description
Used to match windows filenames. Fails if there is leading or trailing spaces. Fails if the input contains /\:*?"<>| . Fails if the input begins or ends with '.'
Matches
Test.txt | T est.txt | Rosco's.Test.txt
Non-Matches
\Folder\Test.txt | T*est.txt | Test.
Author Rating: The rating for this expression. Rosco Pikotrain
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: Fixed the problem of allowing ':'
Name: Rosco
Date: 3/31/2005 12:47:24 PM
Comment:
Now properly fails when a colon is included anywhere in the file name.


Title: Doesn't work according to spec
Name: l0b0
Date: 3/29/2005 8:28:42 AM
Comment:
Doesn't fail when the input contains ":", as in "test:a.jpg", although it should


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