mirror of
https://github.com/rad4day/Waybar.git
synced 2025-08-04 22:52:51 +02:00
Regular expression improved
This commit is contained in:
@@ -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("\\{\\}"),
|
std::regex_replace(config_["format-calendar-weeks"].asString(), std::regex("\\{\\}"),
|
||||||
(first_day_of_week() == date::Monday) ? "{:%V}" : "{:%U}");
|
(first_day_of_week() == date::Monday) ? "{:%V}" : "{:%U}");
|
||||||
weeks_format_left_gaps =
|
weeks_format_left_gaps =
|
||||||
std::regex_replace(weeks_format_, std::regex(".*<b>|</b>.*|\\{.?+\\}"), "").length();
|
std::regex_replace(weeks_format_, std::regex("</?[^>]+>|\\{.*\\}"), "").length();
|
||||||
} else {
|
} else {
|
||||||
weeks_format_ = "";
|
weeks_format_ = "";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user