Construction time of a std::regex variable might be a bottleneck.
Thus we should never declare it as non-static block-scope variable in order to variable gets initialised only once.
std::regex r1("(.*)"); // OK
static std::regex r2("(.*)"); // OK
void process() {
std::regex r3("(.*)"); // INCORRECT
static std::regex r4("(.*)"); // OK
}