I wonder if this should be reused across all text buffers as a class level global, that pattern was used by the token class in core for performance improvements.