Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to verify an Indian mobile number using regular expression in R?

Description

To verify an Indian mobile number using regular expression in R

Process

  Load the mobile number

  Check whether the number is of ten digits.If true then it is a valid mobile number.Else it is invalid mobile number

Sapmle Code

mob.no=readline(prompt = “Enter the mobile number : “)
if(length(unlist(regmatches(mob.no,gregexpr(“[[:digit:]]”,mob.no))))==10)
{
cat(“\nThe mobile number is valid\n”)
}else
{
cat(“The mobile number is invalid\nPlease enter a valid mobile number”)
}

Screenshots
verify an Indian mobile number using regular expression in R
Load the mobile number
Check whether the number is of ten digits.If true then it is a valid mobile number