示例#1
0
        public static string NewLastNameChecker()
        {
            string namePattern = RegexAndLoginExpressions.nameRegex();
            Match  rxLname     = Regex.Match("", namePattern);
            string lname       = "";

            while (!rxLname.Success)
            {
                // Last Name
                Console.Clear();
                Console.WriteLine("\n ---- last name ----");
                RegexAndLoginExpressions.quitPrompt();
                lname = Console.ReadLine();
                if (lname.Equals("quit"))
                {
                    return("quit");
                }
                rxLname = Regex.Match(lname, namePattern);
            }
            return(lname);
        }
示例#2
0
        public static string NewFirstNameChecker()
        {
            string namePattern = RegexAndLoginExpressions.nameRegex();
            // phone pattern complete
            Match  rxFname = Regex.Match("", namePattern);
            string fname   = "";

            while (!rxFname.Success)
            {
                // First Name
                Console.Clear();
                Console.WriteLine("\n ---- first name ----");
                RegexAndLoginExpressions.quitPrompt();
                fname = Console.ReadLine();
                if (fname.Equals("quit"))
                {
                    return("quit");
                }
                rxFname = Regex.Match(fname, namePattern);
            }
            return(fname);
        }