From 9d441462240b764a358c102ab017036d87a9192f Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:16:17 +0200 Subject: [PATCH] Regex assert Co-authored-by: SaltySnail <51403141+SaltySnail@users.noreply.github.com> --- include/Utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/Utils.h b/include/Utils.h index 50cac74..a61c1be 100644 --- a/include/Utils.h +++ b/include/Utils.h @@ -89,6 +89,7 @@ namespace Utils { result.append(input, lastPos, match.position() - lastPos); std::wstring varName; + assert(match.size() == 4 && "Input regex has incorrect amount of capturing groups"); if (match[1].matched) varName = match[1].str(); // %VAR% else if (match[2].matched) varName = match[2].str(); // $VAR else if (match[3].matched) varName = match[3].str(); // ${VAR}