regex optimizations