Macros! https://github.com/wyantb/js-regex#macros
Given some named macro, whenever the user wants to use it, they use addMacro (or some analogous method).