Java tutorial
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean isIdOk(String Idstr) { //account String regex = "[\u4e00-\u9fa5_a-zA-Z0-9_]{2,30}"; Pattern pattern = Pattern.compile(regex); return pattern.matcher(Idstr).matches(); } }