Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

HTML Rendering – Check if a string is Html

Determines whether a given string contains basic HTML content.

The function checks for the presence of common HTML elements such as “html”, “body”, “table”, “div”, “p”, etc. using a regular expression. It looks for matched opening and closing tags. If the input is null, empty, or contains no HTML-like structure, the function returns False.

VB
    Public Function IsHtmlContent(input As String) As Boolean
    
        If String.IsNullOrWhiteSpace(input) Then
            Return False
        End If

        ' Check basic HTML tags
        Dim htmlPattern As String = "(?i)<(html|body|table|tr|td|h[1-6]|div|span|p|a|img|ul|ol|li|br|hr|th)[^>]*>.*<\/\1>"
        Dim regex As New Regex(htmlPattern)

        ' Se trova almeno un match, è HTML
        Return regex.IsMatch(input)
    End Function

Posted by ipercube


© 2026 Ipercube Design