15 #include <QRegularExpression> 23 QRegularExpression Rx_;
25 static bool IsFast ();
28 RegExp (
const QString&, Qt::CaseSensitivity);
30 bool Matches (
const QString&)
const;
31 bool Matches (
const QByteArray&)
const;
33 QString GetPattern ()
const;
34 Qt::CaseSensitivity GetCaseSensitivity ()
const;
44 :
Shift_ { std::max<qsizetype> (shift, 1) }
53 const QRegularExpression& rx,
55 requires requires { { replacer (body, QRegularExpressionMatch {}) } -> std::convertible_to<ReplacerResult>; }
61 const auto& match = rx.match (body, pos);
62 if (!match.hasMatch ())
67 [&] (
ReplaceAdvance adv) { pos = match.capturedStart (0) + adv.Shift_; });
ReplaceAdvance(qsizetype shift)
std::variant< StopReplace, ReplaceAdvance > ReplacerResult
auto Visit(const Either< Left, Right > &either, Args &&... args)
requires(Tup1Size==Tup2Size) const expr auto ZipWith(Tup1 &&tup1
UTIL_SLL_API QDataStream & operator>>(QDataStream &, LC::Util::RegExp &)
bool Matches(const QString &string, const LC::AN::StringMatcher &pattern)
Q_DECLARE_METATYPE(QVariantList *)
UTIL_SLL_API QDataStream & operator<<(QDataStream &, const LC::Util::RegExp &)
void ReplaceByRegexp(QString &body, const QRegularExpression &rx, R &&replacer) requires requires