下载地址:
下载地址1(本站为飞网专业下载站,域名:down.cfei.net)
资源简介:
package com.hexiang.utils.tools;import java.util.TreeMap;import java.util.regex.Matcher;import java.util.regex.Pattern;public class StringCounter { /** * 正则统计字符串出现次数 * * @param source * @param regexNew * @return int */ public static int finder(String source, String regexNew) { String regex = "[a-zA-Z]+"; if (regexNew != null && !regexNew.equals("")) { regex = regexNew; } Pattern expression = Pattern.compile(regex); Matcher matcher = expression.matcher(source); TreeMap