엄격 한 핸드폰 번호 정규 표현 식 표기 법 - 자바

더 엄격 한 핸드폰 번호 정규 표현 식 쓰기 - 자바
이동: 134, 135, 136, 137, 138, 139, 150, 151, 157 (TD), 158, 159, 187, 188
연통: 130, 131, 132, 152, 155, 156, 185, 186
전신: 133, 153, 180, 189, (1349 위 통)
상세 참조: http://liaojuncai.iteye.com/blog/1986310
그럼 이제 정규 매 칭 테스트 를 할 수 있 습 니 다.
코드 는 다음 과 같 습 니 다:
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class ClassPathResource {
	public static boolean isMobileNO(String mobiles){
		Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
		Matcher m = p.matcher(mobiles);
		System.out.println(m.matches()+"---");
		return m.matches();
	}
	public static void main(String[] args) throws IOException {
		System.out.println(ClassPathResource.isMobileNO("13245184639"));
	}

}

좋은 웹페이지 즐겨찾기