regex generator: make shorter regex