String str = "@郭剑锋_"; String regEx = "@|_"; // 表示@或_ Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(str); boolean rs = m.find(); System.out.println(rs);