val UserMobile = findViewById<edittext>(R.id.UserMobile)
val msgUserMobile: String = UserMobile.text.toString()
fun String.isMobileValid(): Boolean {
// 11 digit number start with 011 or 010 or 015 or 012
// then [0-9]{8} any numbers from 0 to 9 with length 8 numbers
if(Pattern.matches("(011|012|010|015)[0-9]{8}", msgUserMobile)) {
return true
}
return false
}
if(msgUserMobile.trim().length==11&& msgUserMobile.isMobileValid())
{//pass}
else
{//not valid}