public final static String SEARCHKEYREGEX = "[~!/@#$%^&*()\\-_=+\\|[{}];:\'\",<.>/?]+";
//!@~#¥%……&*()——+{}|:“《》?-=【】、;‘,。、
public static void main(String []a ) { Matcher m = null; String searchKey = "1!"; if(StringUtils.isNotEmpty(searchKey)) { System.out.println(SEARCHKEYREGEX); Pattern p = Pattern.compile(SEARCHKEYREGEX); m = p.matcher(searchKey); System.out.println(m.find()); } }
原文链接:https://www.f2er.com/regex/362083.html