MyStringUtil.containsPattern() Leave a Comment / Java / April 30, 2010 April 30, 2010 public static boolean containsPattern(String text, String regex) { Pattern p = Pattern.compile(regex); Matcher m = p.matcher(text); return m.find(); }