Answers for "10 digit mobile number validation in regex"

0

regex for accepting mobile number only in 10 digit

Copy CodeRegex reg = new Regex(@"^[0-9]{10}$");
string inputOK = "9876543214";
string inputBad1 = "876543214";
string inputBad2 = "09876543214";
if (reg.IsMatch(inputOK)) Console.WriteLine("OK");
if (!reg.IsMatch(inputBad1)) Console.WriteLine("OK");
if (!reg.IsMatch(inputBad2)) Console.WriteLine("OK");
Posted by: Guest on March-23-2021
0

india mobile number 10 digit number regex

/^(?:(?:+|0{0,2})91(s*|[-])?|[0]?)?([6789]d{2}([ -]?)d{3}([ -]?)d{4})$/
Posted by: Guest on November-09-2021

Code answers related to "10 digit mobile number validation in regex"

Browse Popular Code Answers by Language