Here you can find the source of isValidChar(String strInput)
public static boolean isValidChar(String strInput)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isValidChar(String strInput) { String strPattern = "^[0-9a-zA-Z]*$"; Pattern p = Pattern.compile(strPattern); Matcher m = p.matcher(strInput); return m.matches(); }//from www. j a v a2 s . c o m }