-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 5.14.0
-
Fix Version/s: 5.14.2, 5.15.0 Alpha
-
Component/s: Core: QString and Unicode
-
Labels:None
-
Platform/s:
-
Commits:9f1948f59b916966ea0ecdf9c7d3473f7685e08e (qt/qtbase/5.14)
QRegularExpression::wildcardToRegularExpression() returns a pattern anchored with \A and \z, the issue is that the documentation doesn't mention that fact, which means that when porting code that used QRegExp::exactMatch() and QRegExp::WildCard the code could end up like this:
QRegularExpression::anchoredPattern(QRegularExpression::wildcardToRegularExpression(pattern))
which means the pattern is anchored twice, which is wrong.
This was pointed out to me by a KDE developer/contributor in a code review: https://phabricator.kde.org/D26205
Harald Sitter on IRC #kde-devel also pointed out that https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qdiriterator.cpp#n184 has the same problem.