On our form we allow users to provide a value, that will eventually be used to create a folder on our network share. before we were just validating that they provided a value that was min length(basically to make sense as a folder)
but now we found that they are taking it to serious and trying to use some invalid characters that windows doesnt like
so i was tryign to implement some regex to replace any of the invalid characters with dashes
what is wrong with this code that my value never gets replaced.
string cust1 = lblCustomerNumber.Text;
string patt = @"^[^\\\./:\*\?\""<>\|]{1}[^\\/:\*\?\""<>\|]{0,254}$";
string replacePatt = "-";
string cust = Regex.Replace(cust1, patt, replacePatt);
cust always has the original value from cust1, it never gets replaced.
Am i using this wrong?
Something else i ...
Go to the complete details ...