public static int countRegex(@Nonnull String pattern, @Nullable String text) {
		if (text == null || text.isEmpty())
			return 0;
		int count = 0;
		Matcher matcher = RegexUtil.pattern(pattern).matcher(text);
		while (matcher.find())
			count++;
		return count;
	}
@param pattern
		Regex pattern to look for.
@param text
		Text to check.

@return Number of times the given pattern appears in the text.
recaf-core/src/main/java/software/coley/recaf/util/StringUtil.java