Improve regular expression tokenization.