I am using Regular Expressions in VB.NET to find illegal filename characters in a string. The user enters and name, and it then saves the file with that name. I just need to make sure that the filename doesn't contain illegal filename characters.
The characters are / \ : ? " < > | (is there any others?)
I am using the following regex at the moment, but it doesn't seem to be picking up backslashes.
CODE
Dim myRegex As New System.Text.RegularExpressions.Regex("[\/:?'=<>|]")
Every other character it picks up, why just this one? Also the " character is illegal, how can i put that into the regex (at the moment it thinks its part of the code and not the regex)
If there is another way to do the same thing, or a different regex, that would be nice!
Thanks,
-jimmy

