Regular expression improved

This commit is contained in:
Viktar Lukashonak 2022-12-10 18:36:58 +03:00
parent 9218968d2f
commit 4c4d09992e
No known key found for this signature in database
GPG Key ID: 08A413AA87200A6F

View File

@ -80,7 +80,7 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config)
std::regex_replace(config_["format-calendar-weeks"].asString(), std::regex("\\{\\}"),
(first_day_of_week() == date::Monday) ? "{:%V}" : "{:%U}");
weeks_format_left_gaps =
std::regex_replace(weeks_format_, std::regex(".*<b>|</b>.*|\\{.?+\\}"), "").length();
std::regex_replace(weeks_format_, std::regex("</?[^>]+>|\\{.*\\}"), "").length();
} else {
weeks_format_ = "";
}