The best way to optimize regular expressions (regexes) at scale is to not use regular expressions. But the telemetry tooling we have available sometimes doesn’t give us the option of avoiding regular expressions, and we have to deal with them anyway. This chapter is about making the regexes you must use perform the best they can. Much like programming, regexes are used for two reasons in a telemetry pipeline: