I am trying to get a regex working but cannot get it right. I am trying to write a regex c# that would allow all special chars except comma, single quotes & double quotes. But cant get it to work.
I have the below code:
Regex alphaNumericRegex = new Regex(@"^[\w]*$", RegexOptions.IgnoreCase);
I tried using
^[^'",][a-zA-Z0-9~`!@#$%^&*()_+-={}[]|\:;<>.?/]*$
where I thought the first negate [] set is for the chars which I dont want to allow.
But this does not work. There must be a simpler way to do this.
Sorry I know there are many regex posts around but somehow I cant get mine to work even after reading them.
Would appreciate inputs.