public static bool IsValid (string postcode)
{
if (postcode == "") return true;
System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ])\ {0,1}(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$");
return r.IsMatch(postcode.ToUpper());
}
No comments:
Post a Comment