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()) {