Support Windows in Regex

This commit is contained in:
ZeldaZach 2025-01-19 08:13:42 -05:00
parent e95a5bd797
commit 6e0ed887c2
No known key found for this signature in database

View file

@ -61,7 +61,7 @@ static void CockatriceLogger(QtMsgType type, const QMessageLogContext &ctx, cons
QString logMessage = qFormatLogMessage(type, ctx, message); 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 // 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); QRegularExpressionMatch match = regex.match(logMessage);
if (match.hasMatch()) { if (match.hasMatch()) {