From e06b520427a30f1c86562ad7cc3794bf03b40188 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:21:44 +0100 Subject: core: Move regex from stdlib to re2 (#8736) Moves the regex handling from stdlib to re2 --- hyprctl/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hyprctl/main.cpp') diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 55c3cc7e..676c8b98 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -1,3 +1,5 @@ +#include + #include #include #include @@ -23,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -281,11 +282,10 @@ int requestHyprpaper(std::string arg) { } void batchRequest(std::string arg, bool json) { - std::string commands = arg.substr(arg.find_first_of(" ") + 1); + std::string commands = arg.substr(arg.find_first_of(' ') + 1); - if (json) { - commands = "j/" + std::regex_replace(commands, std::regex(";\\s*"), ";j/"); - } + if (json) + RE2::GlobalReplace(&commands, ";\\s*", ";j/"); std::string rq = "[[BATCH]]" + commands; request(rq); -- cgit v1.2.3