I require a regular Expression to validate FileName in C# that ignores everything except all upper/lower alpha chars, numbers, backslash, underscore, period, dash, etc. "*" and "?" for wildcards. I want to use that in RegEx.IsMatch(fileName,expression)
Asked
Active
Viewed 68 times
0

Jasper Blues
- 28,258
- 22
- 102
- 185

Ravi
- 853
- 8
- 17
-
[something like this](http://stackoverflow.com/questions/15157428/regex-pattern-match-a-filename) – Ravi Nov 01 '13 at 10:15
-
Be aware that invalid filenames exist that are made up entirely of valid characters, like `NUL` or `COM1` etc... – Tim Pietzcker Nov 01 '13 at 10:32
-
You really should at least give learning regular expressions a go. It is extremely easy when you start at the beginning. – Gusdor Nov 01 '13 at 10:32
-
1@Ravi And what's wrong with it? You should have an idea how an expression for what you want could look like so try create one your self. – Ondrej Janacek Nov 01 '13 at 10:32