I'm not sure if you had a better approach to solving the "there's both a regex thing and a proper html5ever based thing" problem, but this works I guess :)