I'm porting a Qt5 application to Qt6. I want to move away from Qt5CoreCompat module of Qt6 as soon as possible. My problem is with QRegExp
class which should be replaced with QRegularExpression
class. Most patches are relatively trivial but how can I port QRegExp::exactMatch()
in Qt6. Here is some code from the application:
QRegExp version(QLatin1String("(.+)_v(\\d+)"));
if (version.exactMatch(completeBaseName/*QString*/))
{
// some code
}
I don't see a way to do this in QRegularExpressionMatch
class. I guess solution might be something like this:
QRegularExpression version(QLatin1String("(.+)_v(\\d+)"));
QRegularExpressionMatch match = version.match(completeBaseName);
if (match.hasMatch())
{
// Find exact match or not
}
I want to have the same behavior as before.