Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368474 - [implementation] Find / Replace; Escape Regular Expression routine leaves out leading zero
Summary: [implementation] Find / Replace; Escape Regular Expression routine leaves out...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 12:45 EST by Jeremy Flicker CLA
Modified: 2012-01-13 06:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Flicker CLA 2012-01-12 12:45:44 EST
Build Identifier: Version: 3.6.2 Build id: M20110210-1200

The method FindReplaceDocumentAdapter.escapeForRegExPattern(String), when handed a character less that \x20, will often escape that character using the \xhh format.  However, if the leading digit is a 0, the 0 will not be included in the escaped string.

This leads to at least one defect in the base eclipse experience described below... plus my product is re-using this method so it would help my product to also fix this

Reproducible: Always

Steps to Reproduce:
1.Open a text editor
2. Engage find / replace
3. Enable regular expressions
4. Replace a character in your file with the escape sequence \x08
5. Now that character is in your text file
6. Close find \ replace
7. Select that character in the text editor
8. Re-engage find \ replace.
9. The Find dialog appears with the value \x8 in the Find text field.

\x8 is not a valid regular expression escape sequence, so pressing find will give the user an error message saying as much.
Comment 1 Dani Megert CLA 2012-01-13 06:01:56 EST
Bug in FindReplaceDocumentAdapter.escapeForRegExPattern(String).
Comment 2 Dani Megert CLA 2012-01-13 06:19:16 EST
Fixed in master: ff9f8f3686f510c0a4a153225ebe8a5d4f092f9f