From 6e0ed887c2276abd46e565a96ac9153ccb0e5ad3 Mon Sep 17 00:00:00 2001 From: ZeldaZach Date: Sun, 19 Jan 2025 08:13:42 -0500 Subject: [PATCH] Support Windows in Regex --- cockatrice/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 7fdb91bae..f5f2e5871 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -61,7 +61,7 @@ static void CockatriceLogger(QtMsgType type, const QMessageLogContext &ctx, cons QString logMessage = qFormatLogMessage(type, ctx, message); // Regular expression to match the full path in the square brackets and extract only the filename and line number - QRegularExpression regex(R"(\[\/.*\/([^\/]+\:\d+)\])"); + QRegularExpression regex(R"(\[(?:.:)?[\/\\].*[\/\\]([^\/\\]+\:\d+)\])"); QRegularExpressionMatch match = regex.match(logMessage); if (match.hasMatch()) {