Bug 80667 - [find/replace] Regex replace patterns should interpret character patterns
Summary: [find/replace] Regex replace patterns should interpret character patterns
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 enhancement with 1 vote (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 57938 (view as bug list)
Depends on:
Blocks: 132833
  Show dependency tree
 
Reported: 2004-12-10 03:32 EST by Markus Keller CLA
Modified: 2007-07-23 09:50 EDT (History)
3 users (show)

See Also:


Attachments
Fix (31.03 KB, patch)
2007-06-14 15:03 EDT, Markus Keller CLA
no flags Details | Diff
Combined fix for 44422, 80667, and 51530 (37.21 KB, patch)
2007-07-03 09:59 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.