return optimised regexp

pre-check for group param