示例#1
0
 /**
  * Check whether the passed text looks like it contains XHTML code. This is a heuristic check only
  * and does not perform actual parsing!
  *
  * @param sText The text to check.
  * @return <code>true</code> if the text looks like HTML
  */
 public static boolean looksLikeXHTML(@Nullable final String sText) {
   // If the text contains an open angle bracket followed by a character that
   // we think of it as HTML
   // (?s) enables the "dotall" mode - see Pattern.DOTALL
   return StringHelper.hasText(sText)
       && RegExHelper.stringMatchesPattern("(?s).*<[a-zA-Z].+", sText);
 }