I'm not aware of any tools out of the box, but you could trivially build your example regex from a Trie which is also easy to construct.
https://en.wikipedia.org/wiki/Trie#Algorithms
I'm not so sure it would take up much less space though, if you take gzip compression into account. See for example here:
https://github.com/google/closure-compiler/wiki/FAQ#closure-...