5
Answers

how can validate special characters in textbox c#.net

hi ,

I am writing this code to validate special characters

Regex r = newRegex(@"[~`!@#$%^&*()-+=|\{}':;.,<>/?]");

      if (r.IsMatch(txtJobPackName.Text))

                {                

 MessageBox.Show("special characters are not allowed !!!");

                   TextBox1.Text ="";

                }

but my problem is that i am not able to validate some charater( []-_ " ). can you please give the sulotation. its urgent.

 


 

Answers (5)