Here you can find the source of checkPostalcode(String postalCode)
public static boolean checkPostalcode(String postalCode)
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean checkPostalcode(String postalCode) { return Pattern.matches("[0-9]\\d{5}", postalCode); }/*from ww w. j a v a 2s . c o m*/ }