![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java-字符串
松松松松鼠
普通的一枚搬砖小哥
展开
-
字符串判断包含键盘上特殊字符通过正则表达式
/** * 键盘上特殊符号 */ public static final String SPECIAL_CHARACTER_REGEX = "[`~!@#$%^&*()_\\-+=<>?:\"{}|,.\\\\/;'\\[\\]、·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘',。、]"; public static void main(String[] args) { Matcher mat...原创 2020-10-21 15:39:40 · 752 阅读 · 0 评论 -
string判断或者过滤字符串特殊字符
下面展示一些 内联代码片。判断是否包含特殊字符// An highlighted blockprivate static boolean isEmojiCharacter(int codePoint) { return (codePoint >= 0x2600 && codePoint <= 0x27BF) // 杂项符号与符号字体 || codePoint == 0x303D || codePoint == 0x2049 || codePoin原创 2020-10-19 15:37:23 · 1113 阅读 · 0 评论 -
java中对字符串进行特殊字符的过滤
用Pattern 和Matcher 搞定String REG_EX = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";String str = "!@#$%^&*()~`:;<>,.?/";Pattern p = Pattern.compile(REG_EX);Matcher m = p.matcher(str);//str待过滤的字符串String resul原创 2020-09-22 14:33:07 · 1914 阅读 · 0 评论