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

Bug 355417

Summary: Support regexp replace
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: EditorAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: adrian.aichner, john.arthorne, libingw
Version: 0.2   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: All   
Whiteboard:

Description Mark Macdonald CLA 2011-08-22 13:47:04 EDT
Find/replace should allow you to use special syntax in the "Replace" field to refer to special characters (eg. \n, \t) as well as parenthesized groups captured from the matched text.

Example:
   Find: (var|function)
   Replace: \1\t
   Regular expression: (checked)
Should find occurrences of "var" and "function" and insert a tab character after them.



See also
[1] https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter
Comment 1 Adrian Aichner CLA 2012-12-03 11:21:58 EST
Greetings All!

Please consider my pull request
https://github.com/eclipse/orion.client/pull/20
to implement this enhancement.

I wrote all this code, and I have the right to contribute it to Eclipse under the eclipse.org website terms of use.

Regards
Adrian
Comment 2 libing wang CLA 2012-12-04 09:23:07 EST
Hi, anaran, 
I had a quick review of your code and they look good.
I will merge them into our master branch very soon.
Thanks a lot ,

-Libing
Comment 4 John Arthorne CLA 2012-12-10 16:18:29 EST
It looks like this works for "Replace", but not for "Replace All". Entered bug 396224. Cool feature though!