Make the full document regex hack a bit more robust

Anchor the regex and make it look for doctype too

Change-Id: I43abb6f214a28801642bde46b50f4ac12614d1e4
Make string type matches override regex type matches

Change-Id: Ic21e27c047d8cb1161a6613bb5232d0d19b37aa6
Merge "Make string type matches override regex type matches"
Merge "Make the full document regex hack a bit more robust"