i would like to know how to make my app work the way i want it... at first my app is like this> a user types anything in a textbox and as long as it's a length of 9 or 12 it'll open a form..
here's a small part from my program:
private bool Validate(string Val)
{
if(Val!="")
{
if(Val.Length==9||Val.Length==12)
{
return true;
}
else
return false;
}
else
return false;
}
now i want to make sure that the user either keys in
i) length of 12 numbers eg. 123456123456
OR
ii) a letter that is either s/S/f/F + any 7 numbers + any 1 letter and in this order only eg. F1234567P
to be able to open the form.
here's something i got but donno how to go on from here: (and i donno if it's usable in my program)
input.Length == 9 && System.Text.RegularExpressions.Regex.Match(input, @"[sSfF]\d{7}\w").Success
pls help
thanks