| [3.0 M5] Regular expression replacement expressions... [message #167129] |
Mon, 08 December 2003 07:35  |
Eclipse User |
|
|
|
Originally posted by: marcus.edwards.digitalsteps.com
Hi,
I'm trying to determine whether the following is a bug or a
misunderstanding/misconfiguration on my part. The problem seems to be that
when using regular expressions, the replace field with group expression is
no longer working.
Test case:
- open java perspective, open java source file
- Ctrl+F to bring up the search and replace dialog
- enter a search expression including a group, e.g. "Long ([^;]*);" -- find
all occurances of a Long field declarations.
- enter a replacement expression referencing the group, e.g. "Double \1;" --
change field type to Double.
- ensure 'Regular expressions' is checked on
Test data:
public class Test
{
private Long foo = new Long(123);
}
Results:
public class Test
{
private Double 1; // ?!? the regex matching group is being interpreted
as a literal
}
The regex help in the dialog indicates that I've got the right syntax so
something else must be wrong. I've tried various combinations including \\1.
/1. //1. \0 etc. all of which produce the wrong result.
Any ideas?
Thanks,
Marcus
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04817 seconds