| Summary: | [find/replace] regex should support \R for any linebreak | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Text | Assignee: | Platform-Text-Inbox <platform-text-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | Keywords: | helpwanted |
| Version: | 3.1 | ||
| Target Milestone: | 3.4 M1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Markus Keller
Not for 3.1 > The implementation could just replace \R in the find pattern by the document's > line delimiter. This will not work in all cases. E.g. for a Windows (\r\n) file, there's no straightforward way to replace \R in an expression like [x\R]\t, since character sets (in []) can only match single characters. However, we could just replace \R with (?:\r\n?|\n) (a non-capturing group that matches any line delimiter) outside of characters sets and throw a PatternSyntaxException in case \R is used inside a character set (similar to what happens for e.g. (.)[\1]. That would solve most real cases and not try to solve the unsolvable. See also bug 52338 and bug 80667. Thanks Markus. Patch committed to HEAD. Available in builds > N20070715-0010. |