LubosD / twinkle

Qt 5 port of Twinkle
http://twinkle.dolezel.info
GNU General Public License v2.0
169 stars 49 forks source link

qt5+: Switch from `QRegExp` to `QRegularExpression` #301

Closed fbriere closed 1 year ago

fbriere commented 2 years ago

QRegularExpression was introduced in Qt 5.0 as a successor to QRegExp, and while it is still supported under Qt 6 (via Core5Compat), the corresponding QRegExpValidator is not. Hence, migrating will be required before being able to port to Qt 6 (#297).

While QRegularExpression is not always a drop-in replacement for QRegExp (see the documentation¹ for details), in our case, it is. Our use doesn't run into any of the situations listed in the documentation, while our only instance of exactMatch() uses a pattern that is already anchored.

¹ https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users