Regex assert

Co-authored-by: SaltySnail <51403141+SaltySnail@users.noreply.github.com>
This commit is contained in:
Tixx 2025-06-24 22:16:17 +02:00 committed by GitHub
parent a5c02217fa
commit 9d44146224
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}