Pimcommon

needupdateparsehtmlutil.cpp
1/*
2 SPDX-FileCopyrightText: 2025 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "needupdateparsehtmlutil.h"
8#include <QRegularExpression>
9QString PimCommon::NeedUpdateParseHtmlUtil::extractDate(const QString &dataHtml)
10{
11 if (dataHtml.isEmpty()) {
12 return {};
13 }
14 // By default generated html page will not changed in the future
15 static const QRegularExpression reg(QStringLiteral("<td align=\"right\">(\\d+\\-\\d\\d\\-\\d\\d).*<"));
16
17 const QRegularExpressionMatch match = reg.match(dataHtml);
18 if (match.hasMatch()) {
19 const QString matched = match.captured(1);
20 return matched;
21 }
22 return {};
23}
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:47:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.