Avoid duplicate regexp instantiations