Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355417 - Support regexp replace
Summary: Support regexp replace
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: 0.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 2.0 M1   Edit
Assignee: libing wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 13:47 EDT by Mark Macdonald CLA
Modified: 2012-12-10 16:18 EST (History)
3 users (show)

See Also:


Attachments

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