1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
/*
SPDX-FileCopyrightText: 2025-2026 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "needupdateparsehtmlutil.h"
#include <QRegularExpression>
QString TextAddonsWidgets::NeedUpdateParseHtmlUtil::extractDate(const QString &dataHtml)
{
if (dataHtml.isEmpty()) {
return {};
}
// By default generated html page will not changed in the future
static const QRegularExpression reg(QStringLiteral("<td align=\"right\">(\\d+\\-\\d\\d\\-\\d\\d).*<"));
const QRegularExpressionMatch match = reg.match(dataHtml);
if (match.hasMatch()) {
const QString matched = match.captured(1);
return matched;
}
return {};
}
|