Java tutorial
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static Pattern PATTERN_FIXEDPHONE; public static boolean isFixPhone(String number) { Matcher match = PATTERN_FIXEDPHONE.matcher(number); return match.matches(); } }