Hi I'm trying to ensure text box does not contain any of the following characters:
! @ # $ % ^ & * ( ) < > ‘ ’+ [ ] ? { } | , ; : . “ ~ `
I'm trying to use regular expression with C# server side code: something like the below (but I think my regular expression is wrong):
Regex reg = new Regex(@"^[^\%\/\\\&\?\,\'\;\:\!\+\$#\^\*\(\)\|~]+$");//! @ # $ % ^ & * ( ) < > ‘ ’+ [ ] ? { } | , ; : . “ ~ `
if(!Regex.IsMatch(Textbox_Timetable.Text.Trim(), @"^[^\%\/\\\&\?\,\'\;\:\!\-]+$"))
AddError("Timetable Name must not contain following characters: " + @"\%\/\\\&\?`\,\'\;\:\!\-");