package utils import "regexp" func Filter[A any](arr []A, f func(A) bool) []A { var res []A res = make([]A, 0) for _, v := range arr { if f(v) { res = append(res, v) } } return res } func IsValidHTML(input string) bool { // Check for declaration (case-insensitive) doctypeRegex := regexp.MustCompile(`(?i)`) if !doctypeRegex.MatchString(input) { return false } // Check for and tags (case-insensitive) htmlTagRegex := regexp.MustCompile(`(?i)[\s\S]*?`) if !htmlTagRegex.MatchString(input) { return false } // Check for and tags (case-insensitive) bodyTagRegex := regexp.MustCompile(`(?i)[\s\S]*?`) return bodyTagRegex.MatchString(input) }