code: public static boolean getMatchResult(String str, String expr)
      {
          Pattern pattern = Pattern.compile(expr, Pattern.DOTALL);
          return pattern.matcher(str).matches();
      }
docs: Returns <CODE>true</CODE> if the given string matches the given regular expression.
  @param str The string against which the expression is to be matched
  @param expr The regular expression to match with the input string
  @return <CODE>true</CODE> if the given string matches the given regular expression