Use constants for regexp character classes

Let's switch to using constants for the regexp character classes. Doing so allows us to use the most optimal expression for a given regexp engine. It also opens up the door to provide broader support for unicode in the future.

Note that this patch also optimizes the XML entity match expression.