Java tutorial
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isNormalCharValid(String mChar) { boolean isValid = false; String expression = "\\:*?<>|\"\n\t"; CharSequence inputStr = mChar; Pattern pattern = Pattern.compile(expression); Matcher matcher = pattern.matcher(inputStr); if (matcher.matches()) { isValid = true; } return isValid; } }