mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-14 07:02:30 +02:00
feat: rewrite window classes
feat: cache window class rewrite resolution Co-authored-by: Gabriel Fox <Inbox@GabrielFox.Dev>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "util/rewrite_string.hpp"
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <regex>
|
||||
@ -17,7 +18,7 @@ std::string rewriteString(const std::string& value, const Json::Value& rules) {
|
||||
try {
|
||||
// malformated regexes will cause an exception.
|
||||
// in this case, log error and try the next rule.
|
||||
const std::regex rule{it.key().asString()};
|
||||
const std::regex rule{it.key().asString(), std::regex_constants::icase};
|
||||
if (std::regex_match(value, rule)) {
|
||||
res = std::regex_replace(res, rule, it->asString());
|
||||
}
|
||||
|
Reference in New Issue
Block a user