Android Phone Number Check isPhone(String phoneNumber)

Here you can find the source of isPhone(String phoneNumber)

Description

is Phone

Declaration

public static boolean isPhone(String phoneNumber) 

Method Source Code

//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static boolean isPhone(String phoneNumber) {
        String strPattern = "([0-9]{3,4}-)?[0-9]{4,12}";
        Pattern p = Pattern.compile(strPattern);
        Matcher m = p.matcher(phoneNumber);
        return m.matches();
    }/*from   w  ww.j  av a 2 s. c om*/
}

Related

  1. isPhoneNumber(String inputStr)
  2. isPhoneNumber(final String phone)
  3. isTelNumAvailable(String telNum)
  4. isMobile(String mobiles)
  5. isMobileNO(String phoneNum)