Java examples for java.util.regex:Match Phone Number
check Postcode by Regex
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean checkPostcode(String postcode) { String regex = "[1-9]\\d{5}"; return Pattern.matches(regex, postcode); }/*from w w w . j a v a2 s . c o m*/ }