Java tutorial
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isCheckCode(String strCode) { String strPattern = "^[0-9a-zA-Z]{6}"; Pattern p = Pattern.compile(strPattern); Matcher m = p.matcher(strCode); return m.matches(); } }