Optimized regex execution