src/main/java/me/codeboy/common/base/util/CBStringUtil.java
public static int containRegexStatistics(String srcString, String desString) {
        int number = 0;
        while (true) {
            String newString = srcString.replaceFirst(desString, "");
            if (newString.length() == srcString.length()) {
                break;
            }
            number++;
            srcString = newString;
        }
        return number;
    }
public static int containRegexStatistics(String srcString, String desString) {
        int number = 0;
        while (true) {
            String newString = srcString.replaceFirst(desString, "");
            if (newString.length() == srcString.length()) {
                break;
            }
            number++;
            srcString = newString;
        }
        return number;
    }
含模式串的次数

@param srcString 原串
@param desString 目标模式串
@return 次数