To 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.Else it is invalid mobile number
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”)
}