-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 3.5.0, Qt Creator 4.6.0-beta1
-
None
-
*Found on Windows 7 64-Bit
*Likely affects all environments
Qt purportedly follows the Perl conventions for regular expressions. This includes capture groups and backreferences. For instance, let's assume we have the following line of test data:
foobar
Now let's assume we perform the following regex search on this line:
foo(.*)
The "foobar" line will match this search, and "bar" will be captured as the first group. Now let's assume we wanted to replace this line with a new one using the following expression:
baz$1
What we'd expect this to do is replace the "foo" part of "foobar" with "baz" and then append the "bar" first group from our original find expression. After both the find and replace are performed we should end up seeing:
bazbar
Instead, we end up seeing:
baz$1
This may indicate that regular expressions are either not supported at all for the 'replace' portion of 'find and replace' in the editor, or that backreferences are broken here.
It is important to note that this is NOT related to programmatic usage of capture groups with regular expressions using the ".matcher" style syntax. This is for the text editor only.
- relates to
-
QTBUG-37353 QString::replace(QRegularExpression) seems unable to use named groups in back-references
-
- Open
-
For Gerrit Dashboard: QTCREATORBUG-15175 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
223490,3 | Be a bit more perl-like with regular expression replacements | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |