Java 正则表达式使用例子记录
时间:2020-06-16 14:16:51
收藏:0
阅读:25
前言
此篇博客用来记录一些常用的正则表达式
判断是否是全汉字
/** * 判断是否是全中文汉字 * * @param str * @return */ public static boolean isChinese(String str) { String pattern = "[\u4e00-\u9fa5]*"; if (str == null || str.isEmpty()) { return false; } return str.matches(pattern); }
原文:https://www.cnblogs.com/guanxinjing/p/13140111.html
评论(0)