Optimized regexes by removing useless capturing groups