D26205: KWallet: Port QRegExp to QRegularExpression

Ahmad Samir noreply at phabricator.kde.org
Wed Jan 15 15:26:11 GMT 2020


ahmadsamir added inline comments.

INLINE COMMENTS

> blaze wrote in kwallet.cpp:179
> anchoredPattern() is excessive here, it creates a horror like that "\\A(?:\\A(?:[^/]*)\\z)\\z" with the stuff being anchored twice.
> It has to be removed with no doubt at all.

The pattern has to be anchored if we want to replicate what QRegExp::exactMatch() did, with \A and \z or ^ and $.

If you have a test case where it anchoredPattern() anchors twice, file a bug report upstream (to be honest, I don't know whether this is the intended behaviour or not).

> blaze wrote in kwallet.cpp:180
> The output of wildcardToRegularExpression() method is different from what was before and it breaks the app. It has to be replaced with something else.

Any suggestions? QRegularExpression::wildcardToRegularExpression() is what the upstream docs offer:

> Wildcard matching
> 
> There is no direct way to do wildcard matching in QRegularExpression. However, the wildcardToRegularExpression method is provided to translate glob patterns into a Perl-compatible regular expression that can be used for that purpose.

REPOSITORY
  R311 KWallet

REVISION DETAIL
  https://phabricator.kde.org/D26205

To: ahmadsamir, #frameworks, aacid, apol
Cc: blaze, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200115/912f88f1/attachment.html>


More information about the Kde-frameworks-devel mailing list