Version: (using KDE 4.1.0) Installed from: Debian testing/unstable Packages KReplaceDialog [1] allows for replacing text matched by a regular expressions with substituting content from the match using placeholders (\0, \1...). This can be set by giving option BackReference = 512. KFindDialog implements widgets for setting this option in [2]. KReplace only implements placeholder \0 though, which means only substituting the whole match. Currently extracting a partial match from the given regular expression is not supported. I consider this a bug as this functionality is clearly wanted by the UI but not given by the underlying library. This feature is used in the KTextEdit widget. See the Kate implementation on replacing using placeholders [4]. Maybe this can be merged into KReplace. [1] http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKReplaceDialog.html [2] http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/kfinddialog_8cpp-source.html#l00116 [3] http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/kreplace_8cpp-source.html#l00250 [4] http://api.kde.org/4.x-api/kdelibs-apidocs/kate/html/katesearchbar_8cpp-source.html#l00338
Created attachment 26601 [details] Test case See Bug 140837. See attachment for a testcase. This is a PyKDE application that uses a KTextEdit. For any string input a substring string "test" will be substituted with itself and the whole input will be printed to stdout. "Test that" will currently resolve to "\1 that" which shows that \1 is not substituted.
*** Bug 137374 has been marked as a duplicate of this bug. ***
*** Bug 227215 has been marked as a duplicate of this bug. ***
SVN commit 1128317 by dfaure: Finally implement support for other back references than \0 in the find/replace dialog. BUGS: 168226 125443 CCBUG: 201057 M +25 -16 findreplace/kreplace.cpp M +19 -4 tests/kreplacetest.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1128317
*** Bug 158397 has been marked as a duplicate of this bug. ***
*** Bug 140837 has been marked as a duplicate of this bug. ***