Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Pattern; public class Main { public static boolean isFixPhoneValid(String fixPhone) { if (TextUtils.isEmpty(fixPhone)) return false; String regex = "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,5})?$"; return Pattern.matches(regex, fixPhone); } }