Research breakthrough possible @S-Logix pro@slogix.in

Office Address

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