Hi,
I am using the following Regular expression to validate an TextBox:
Regex r = new Regex("[a-zA-Z]{3,20}"
r.IsMatch(txtInput.Text);
This should only let alpha chars be entered, right? Well when i run the code i can enter any characters (numbers, non-standard chars) into the box as long as I have 3 alpha chars in the textbox as well.
Is there an obvious mistake i am making?
Cheers
James
I am using the following Regular expression to validate an TextBox:
Regex r = new Regex("[a-zA-Z]{3,20}"
r.IsMatch(txtInput.Text);
This should only let alpha chars be entered, right? Well when i run the code i can enter any characters (numbers, non-standard chars) into the box as long as I have 3 alpha chars in the textbox as well.
Is there an obvious mistake i am making?
Cheers
James