Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 80667

Summary: [find/replace] Regex replace patterns should interpret character patterns
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: bogofilter+eclipse.org, christof_marti, mhtech
Version: 3.1Keywords: helpwanted
Target Milestone: 3.4 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 132833    
Attachments:
Description Flags
Fix
none
Combined fix for 44422, 80667, and 51530 none

Description Markus Keller CLA 2004-12-10 03:32:36 EST
Regex replace patterns should replace character patterns by their interpreted
value. I.e. when searching for "\xE4" with replace pattern "\xF6", the replace
pattern should also be interpreted (and thus insert ö at the place where an ä
was found).

The character patterns to be interpreted in the replace string are:
\\, \0n, \0nn, \0mnn, \xhh, \uhhhh, \t, \n, \r, \f, \a, \e, \cx,
and (if bug 80666 is implemented) \R.

The interpreted character patterns should then also be added to the replace
field's contant assistant.
Comment 1 Dani Megert CLA 2004-12-10 03:37:07 EST
Not for 3.1
Comment 2 Markus Keller CLA 2004-12-10 03:55:04 EST
It's not fixed, it's LATER.
Comment 3 Markus Keller CLA 2004-12-10 03:55:33 EST
.
Comment 4 Dani Megert CLA 2004-12-10 04:01:19 EST
Nice try he ;-)
Comment 5 Markus Keller CLA 2005-10-12 05:18:48 EDT
This request generalizes bug 52338.
Comment 6 Markus Keller CLA 2007-06-14 15:03:42 EDT
Created attachment 71358 [details]
Fix

Here's a fix with tests. It affects only the replace pattern. The patch also updates and fixes some of the find pattern content assist proposals and help. Moreover, it implements bug 51530.
Comment 7 Markus Keller CLA 2007-06-14 15:05:20 EDT
Changing status to RESOLVABLE NOW.
Comment 8 Markus Keller CLA 2007-07-02 05:04:08 EDT
*** Bug 57938 has been marked as a duplicate of this bug. ***
Comment 9 Markus Keller CLA 2007-07-03 09:59:54 EDT
Created attachment 72953 [details]
Combined fix for 44422, 80667, and 51530

Updated to head. Changes in FindNextAction.java & FindReplaceDialog.java are for bug 44422, rest for the other bugs.
Comment 10 Dani Megert CLA 2007-07-15 10:30:39 EDT
Thanks Markus. I've committed the patch to HEAD with some minor changes (e.g. added missing @since tags). I also removed a break which I think was wrong (see FindReplaceDocumentAdapter.interpretCharacterEscapes) - please verify that this was the right thing to do. In addition, please refactor that long method.

Available in builds > N20070715-0010.
Comment 11 Dani Megert CLA 2007-07-23 09:50:12 EDT
The patch in bug 44766 reworked FindReplaceDocumentAdapter.interpretCharacterEscapes.