-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
5.15.15
-
None
-
-
b22ae069a (dev), e9b42b857 (6.4), 2df508a41 (6.5)
QRegularExpression and QRegExp behave differently.
The behavior of the QRegExp is correct.
The behavior of the QRegularExpression is not correct (at least for test #1)
const QString source = u8"𤭢abcCBA!!!𤭢¥/:/¥𤭢abbbb:/:"; { const QRegExp regex(u8"𤭢"); int c = source.count(regex); std::cout << "QRegExp test #1: Expected: 3, and result is: " << c << std::endl; } { const QRegularExpression regex(u8"𤭢"); int c = source.count(regex); std::cout << "QRegularExpression test #1: Expected: 3, but result is: " << c << std::endl; }
To show the special characters, here is a screenshot:

The output is:
QRegExp test #1: Expected: 3, and result is: 3 QRegularExpression test #1: Expected: 3, but result is: 1
The test program is attached.