I want to replace these characters with string.Empty:'"<>?*/\|
in given Filename
How to do that using Regex
I have tried this:
Regex r = new Regex("(?:[^a-z0-9.]|(?<=['\"]))", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);
FileName = r.Replace(FileName, String.Empty);
but this replaces all special characters with String.Empty.