[DrKonqi] Port QRegExp to QRegularExpression

Authored by ahmadsamir on Mar 14 2020, 6:38 AM.

Description

[DrKonqi] Port QRegExp to QRegularExpression

Summary:
Port QRegExp::exactMatch() by using QRegularExpression::anchoredPattern(),
unless the pattern is already anchored by "^" and "$".

BacktraceLineGdb::parse():

  • set QRegularExpression::DotMatchesEverythingOption, since gdb breaks some stack frame lines to mulitple lines for readability, e.g.: "#5 0x00007f50e99f776f in QWidget::testAttribute_helper (this=0x6e6440,\n attribute=Qt::WA_WState_Created) at kernel/qwidget.cpp:9081\n" this matches QRegExp behaviour where a "." char matches new lines by default.
  • Use clustering parentheses (?:) so as not to capture groups that aren't needed, less bookkeeping for QRegularExpression/PCRE

Replace QRegularExpression with QString comparison, the latter is usually
faster.

All unit tests still pass.

Reviewers: Plasma, davidedmundson, sitter, apol

Reviewed By: sitter

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D28042

Details

Committed
ahmadsamirMar 19 2020, 1:18 PM
Reviewer
sitter
Differential Revision
D28042: [DrKonqi] Port QRegExp to QRegularExpression
Parents
R871:ce461918868d: Bump required version of KF5 to 5.69.0
Branches
Unknown
Tags
Unknown