Use substr to check for doctype rather than regex.