Bagesh kumar singh

Bagesh kumar singh

  • 1.6k
  • 65
  • 102.5k

how can validate special characters in textbox c#.net

Jan 17 2014 10:33 AM

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)