checkHTML :: String -> Bool checkHTML s = isAnf sa && isMetas sm && isEnde se where sw = words s anf = ["<html>","<head>","<title>","</title>"] meta = ["<meta>","</meta>"] end = ["</head>","<body>","</body>","</html>"] sa = take (length anf) sw soa = drop (length anf) sw se = drop (length sw - length end) sw sm = take (length soa - length end) soa isAnf sa = sa == anf isMetas [] = True isMetas sm | sm == [] = True | take 2 sm /= meta = False | otherwise = isMetas (drop 2 sm) isEnde se = se == end
Zuletzt geändert von amo am 04.12.2002 um 05:15 Uhr.