Fix optimisation of regular expressions.

We need to include _ as part of the Pan tokens, so that if_exists and
the like get correctly hightlighted.