Optimized the RegExp builder