From c2670e9ab90bd657e87a1da2c5322e9007dce01f Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:34:02 +0000 Subject: windowrules: rewrite completely (#12269) Reworks the window rule syntax completely --------- Co-authored-by: Mihai Fufezan --- src/desktop/rule/matchEngine/RegexMatchEngine.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/desktop/rule/matchEngine/RegexMatchEngine.cpp (limited to 'src/desktop/rule/matchEngine/RegexMatchEngine.cpp') diff --git a/src/desktop/rule/matchEngine/RegexMatchEngine.cpp b/src/desktop/rule/matchEngine/RegexMatchEngine.cpp new file mode 100644 index 00000000..14e30af1 --- /dev/null +++ b/src/desktop/rule/matchEngine/RegexMatchEngine.cpp @@ -0,0 +1,17 @@ +#include "RegexMatchEngine.hpp" +#include + +using namespace Desktop::Rule; + +CRegexMatchEngine::CRegexMatchEngine(const std::string& regex) { + if (regex.starts_with("negative:")) { + m_negative = true; + m_regex = makeUnique(regex.substr(9)); + return; + } + m_regex = makeUnique(regex); +} + +bool CRegexMatchEngine::match(const std::string& other) { + return re2::RE2::FullMatch(other, *m_regex) != m_negative; +} \ No newline at end of file -- cgit v1.2.3