I have an api which accepts PIN which shouldnt be anything other than numeric. I am using regex to check if the pin contains any other character. This is my regex
var regex = new Regex("[a-zA-Z!@#$&(){}%^*_=;:?<>\\-`.+,/\"]");
I need to add verification for [] brackets also but whenever i put it inside the expression it doesn't work.
var regex = new Regex("[a-zA-Z!@#$&(){}%^*_=;:?<>[]\\-`.+,/\"]");
Do i need to use any special character for this ?