Avoid repeated creation of a simple RegExp object.
Merge pull request #5151 from nnethercote/text_layer_builder-regexp

Avoid repeated creation of a simple RegExp object.