/** * 检测 originText 是否包含 includeText * @param originText 要检测的字符串 * @param includeText 是否包含该字符串 * @return true,即包包含,false则不包含 */ public boolean checkCarrier(String originText,String includeText){ Pattern pattern = Pattern.compile(includeText,Pattern.CASE_INSENSITIVE); // 不区分大小写 Matcher matcher = pattern.matcher(originText); boolean result = matcher.find(); return result; }