Any Specific Tag + Contents
Find specific tags and return them and their contents. In this case, I have used the invalid and little known “spaghetti” tag. Case insensitive for IE.
/<spaghetti[^>]*>(.|\n)*?<\/\s*spaghetti>/i
Meta – Charset
Find the given charset in the page contents. Returns the charset in variable 1. Case insensitive.
/<meta[^>]*charset=\"*([^\"<]+)/i
DocType
Find the given DOCTYPE of a page contents. Case insensitive.
/<!DOCTYPE[^>]*>/i
