I want to enter data into a text box the app is windows forms, what I want to enter is in this format 001-000001
the first two digits are zero the third digit of 1
to 9
the fourth digit a -
of the fifth digit to the tenth of 0
to 9
, how could you do it?
private void txtGuiaRemision_KeyPress(object sender, KeyPressEventArgs e)
{
string valor = txtGuiaRemision.Text;
string re1 = "(\d+)";
string re2 = "([-+]\d+)";
Regex r = new Regex(re1 + re2, RegexOptions.IgnoreCase | RegexOptions.Singleline);
Match m = r.Match(valor);
if (m.Success)
{
String int1 = m.Groups[1].ToString();
String signed_int1 = m.Groups[2].ToString();
}
}
I can not do what I want.