Fix regexp error and make it more robust.

I've encountered nasty script errors on every cursor move when over invalid HTML. This can be avoided by limiting the tag name matching (mostly) to valid names and to include it in a _very nomagic_ search regexp for literal matching.