ReUtil.isMatch
给定字符串是否匹配给定正则
importcn.hutool.core.util.ReUtil; publicclassTest { publicstaticvoidmain(String[] args) { Stringcontent="ZZZaaabbbccc中文1234"; booleanisMatch=ReUtil.isMatch("\\w+[\u4E00-\u9FFF]+\\d+", content); System.out.println(isMatch); } }
输出:true