### Question:
RegUtil { public final static int countSubStrReg(String str, String reg) { Pattern p = Pattern.compile(reg); Matcher m = p.matcher(str); int i = 0; while (m.find()) { i++; } return i; }  final static boolean isNumeric(String src); final static boolean isABC(String src); final static boolean isFloatNumeric(String src); final static boolean isMatche(String str, String reg); final static int countSubStrReg(String str, String reg); final static boolean isEmail(String email); static final String REG_ALNUM; static final String REG_ALPHA; static final String REG_ASCII; static final String REG_BLANK; static final String REG_CNTRL; static final String REG_DIGITS; static final String REG_GRAPH; static final String REG_LOWER; static final String REG_PRINT; static final String REG_PUNCT; static final String REG_SPACE; static final String REG_UPPER; static final String REG_XDIGIT; static final String REG_SPACE_LINE; static final String REG_SPACE_POINT; static final String REG_HTML; static final String REG_EMAIL; static final String REG_FIXED_TELEPHONE; static final String REG_POSTALCODE; static final String REG_IDENTIFICATION_CARD; static final String REG_URL; static final String REG_MOBILE_TELEPHONE; static final String REG_LEGAL_ACCOUNT; static final String REG_IP; }### Answer:
@Test public void testcountSubStrReg() { String str1 = "192是本地址"; assertEquals(1, RegUtil.countSubStrReg(str1, "\\d{3}")); }