Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generator/internal/http_option_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ std::string FormatApiVersionFromPackageName(
std::string FormatApiVersionFromUrlPattern(std::string const& url_pattern,
std::string const& file_name) {
std::vector<std::string> parts = absl::StrSplit(url_pattern, '/');
static std::regex const kRe{R"(v\d+)"};
static auto const* const kVersion = new std::regex{R"(v\d+)"};
for (auto const& part : parts) {
if (std::regex_match(part, kRe)) {
if (std::regex_match(part, *kVersion)) {
return part;
}
}
Expand Down