Title |
Test
Find
Windows Filename
|
Expression |
^[^ \\/:*?""<>|]+([ ]+[^ \\/:*?""<>|]+)*$ |
Description |
This was written for C# and so you should just be able to drop it into your C# program.
Although you can create files with leading and trailing spaces through non-GUI means, the Windows GUI itself eats those spaces if you try to rename the file. For this reason I made the decision to consider file names with leading and trailing spaces invalid.
This has been tested against large data sets. |
Matches |
bla, file.txt, !@#$ |
Non-Matches |
bla , file:txt, /\*? |
Author |
Rating:
Not yet rated.
Tristan DF Wilson
|
Source |
|
Your Rating |
|
Title: This isn't even close
Name: KRowe
Date: 10/11/2015 11:56:34 AM
Comment:
Not only is bla valid but you are missing a ton of edge cases. See http://stackoverflow.com/a/62888/932549 for a more detailed discussion.
Title: armageddon-,&1
Name: armageddon-,&1
Date: 5/15/2014 5:42:38 PM
Comment:
asdf