Community
Participate
Working Groups
Created attachment 189683 [details] Screenshot of UI for multi-line replacement +++ This bug was initially created as a clone of Bug #26780 +++ As an Eclipse IDE user, I want to search & replace multiple lines of text, eg in order to update file copyright headers to incorporate a new licensing scheme. As of Eclipse 3.6.1, the following works nicely for multi-line search: 1. Search > File... , enable the "Regular Expression" checkbox, cancel 2. In an editor, make a multi-line selection 3. Press Ctrl+H, Search --> Multi-line selection is searched (and may be replaced by a single line). But I found no way getting a multi-line replacement done. One idea for supporting this would be a little "Edit Text" icon right to the replacement combo. Clicking that "Edit Text" icon could open a dialog with a multi-line text field for entering (or pasting) the multi-line replacement. Pressing OK would convert that multi-line replacement into something suitable for the single-line combo. See attached screenshot for how we do this in our commercial Eclipse-based product which has its own text search UI. Or, pasting a multi-line selection into the combo could directly convert it into something suitable.
>But I found no way getting a multi-line replacement done. Add the text into the replace field manually: line1\R\line2\line3....
>line1\R\line2\line3.... Of course: line1\Rline2\Rline3....
The following will search multiline, where test could be on line 1 and test 5 on line 20. Of course it's very possibly this recursion will crash eclipse. test(\R|.*?)*test5 (In reply to comment #2) > >line1\R\line2\line3.... > Of course: > line1\Rline2\Rline3....
(In reply to comment #3) This bug is about multi-line *replace*, not search. > The following will search multiline, where test could be on line 1 and test 5 > on line 20. Of course it's very possibly this recursion will crash eclipse. > > test(\R|.*?)*test5 Nested repetition expressions are inherently inefficient. The right way to have "." match line delimiters is to enable single-line mode like this: "(?s)test.*test5" (press Ctrl+Space after "(?" to read the description)
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.