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

Bug 375452

Summary: Should escape regexp when populating 'Find' field
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: EditorAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: Silenio_Quarti
Version: 0.5   
Target Milestone: 4.0 M2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix none

Description Mark Macdonald CLA 2012-03-27 13:47:00 EDT
1. Open a file in the editor.
2. Press Ctrl+F to open Find toolbar, enable Options > Regular Expression.
3. Select some text that contains a regex special character. For example:
    removePrefix(
4. Press Ctrl+F to populate the Find field with the selection.

I expected the regexp character to be escaped as \( so I could search for the selection literally. Instead I see it's not escaped, which means the search will fail.
Comment 1 Silenio Quarti CLA 2013-06-21 13:36:04 EDT
Created attachment 232661 [details]
fix
Comment 2 Silenio Quarti CLA 2013-09-11 14:34:46 EDT
Previous patch was escaping all search strings even if it did not come from a editor selection.  I think only the editor selection should be escaped.

Fixed

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6c54b62775a6e5a8968cf80c6f1f65fe77599ae3