is Chinese Mobile Number by regular expression - Android Internationalization

Android examples for Internationalization:Chinese

Description

is Chinese Mobile Number by regular expression

Demo Code

import android.text.TextUtils;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{

    public static boolean isMobileNumber(String mobiles) {
        Pattern p = Pattern.compile("^(13|14|15|17|18)\\d{9}$");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }//from  w ww. j  a  v a  2 s .c om

}

Related Tutorials