Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Pattern; public class Main { public static Pattern getPostalCodeRegexpPatternForAdminArea(String zipStartsWithRegEx) { if (TextUtils.isEmpty(zipStartsWithRegEx)) { return null; } return Pattern.compile("(" + zipStartsWithRegEx + ").*", 2); } }