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 ) ; }
Check whether the passed text looks like it contains XHTML code . This is a heuristic check only and does not perform actual parsing!