Bug 14277 - [Dialogs] Find, replace and should allow regular expressions
Summary: [Dialogs] Find, replace and should allow regular expressions
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 enhancement with 1 vote (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 19242 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-19 20:15 EDT by Bob Foster CLA
Modified: 2004-01-08 14:27 EST (History)
18 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Foster CLA 2002-04-19 20:15:43 EDT
Most IDEs support regular expressions as search targets and usually as
replacement expressions. Eclipse should, too. There are several pretty decent
open source regex packages to use, in fact, Apache alone has several. I
recommend going with a Perl-compatible (or reasonable subset) package, as that
seems to be the new de facto standard.
Comment 1 Boris Pruessmann CLA 2002-04-20 08:37:57 EDT
+1
Comment 2 Nick Edgar CLA 2002-04-27 20:59:39 EDT
Defer to v3.
Comment 3 Johan Walles CLA 2002-06-18 11:52:06 EDT
OT: Boris, if you wish to be able to vote for bugs, you may want to add yourself
as a CC of bug 12115.
Comment 4 Randy Giffen CLA 2002-08-09 16:30:09 EDT
Reopen to investigate
Comment 5 Dani Megert CLA 2002-08-30 06:09:36 EDT
*** Bug 19242 has been marked as a duplicate of this bug. ***
Comment 6 Jed Wesley-Smith CLA 2002-10-27 22:22:29 EST
AFAIC this is just about the last feature required to make Eclipse the truly 
great IDE platform it promises to be. The lack of this feature means I still 
have to go outside eclipse to do across file search/replace, and even for 
things like searching for whitespace, or things across two lines. The technical 
side should not be too hard, there are some comprehensive libraries with I 
assume compatible licenses around, and although a friendly UI would be more 
complicated, the only other issue apart from time would possibly be performance.

BTW, the new java.util.regex classes in 1.4 should make it pretty simple to 
implement the search functionality as well, although full replacement 
functionality would probably need a bit of work to make robust and usable. I'd 
personally be ok if it was required to run under 1.4 to get this feature, even 
though I could not currently run it on MacOSX.
Comment 7 Daniel Serodio CLA 2003-02-13 15:33:01 EST
What does "v3" in "defer to v3" mean? I agree that find/replace regexps are a
very powerful feature, one of the few things that makes me miss Emacs once in a
while :)
IMHO, Jakarta ORO is more suited than java.util.regex
Comment 8 Gunnar Wagenknecht CLA 2003-02-13 15:36:41 EST
v3 -> Eclipse 3.0
Comment 9 Erich Gamma CLA 2003-02-20 04:17:30 EST
2.1 still has to run on JDK 1.3. We didn't want to add a dependency on the 
apache regexp matcher since JDK 1.4 will include regexp API.

2.2 will use 1.4 as its base platform and we will add regexp support in this 
version.
Comment 10 Dani Megert CLA 2003-02-26 03:08:43 EST
*** Bug 33115 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2003-04-10 13:02:27 EDT
Done for Search. Moving to Text
Comment 12 Dani Megert CLA 2003-04-14 09:38:03 EDT
Had to revert the changes in Search plug-in until 1.4 is available on all
platforms. Reopened bug 33115 to track this in the Search component.

From the eclipse-dev mailing list:

>Please continue to use only J2SE 1.3 APIs in the main Eclipse development 
>stream.
>
>As indicated in the draft 2.2 plan, Eclipse mainline development will be 
>based on the current version of J2SE, namely 1.4. However, for some of the 
>operating environments we still need to identify suitable reference J2SE 
>1.4 implementations to use for development and testing. We won't make the 
>leap until we've completed these investigations. Please refrain from using 
>J2SE 1.4-specific APIs in this stream.
Comment 13 Chris Beck CLA 2003-04-16 16:59:44 EDT
Perhaps you could use http://jakarta.apache.org/oro/index.html instead of the 
JDK 1.4x stuff?
Comment 14 Jed Wesley-Smith CLA 2003-04-23 22:50:48 EDT
could we get this opened again now that 2.1 is out of the way? or do we need to 
wait until 1.4 support is given the green light?

(btw. in regard to comment#13 [Chris Beck] Erich already addressed this in 
comment#7)
Comment 15 Erich Gamma CLA 2003-04-24 02:20:02 EDT
The implementation of regex support has started. Releasing the changes has to 
wait until the entire development switches to 1.4.
Comment 16 Dani Megert CLA 2003-09-18 03:45:52 EDT
This is on the 3.0 M4 plan. Already implemented for File search.
Comment 17 Dani Megert CLA 2003-09-24 03:41:05 EDT
Released this feature to HEAD. Available in builds > I20030924.
The regEx support is based upon 1.4. regex package.

Keeping this bug report open because we still need to provide
- support for the user to enter a regular expression
- F1 help
Comment 18 Adalbert Homa CLA 2003-09-26 14:26:39 EDT
I am using build I20030925, the regular expression seems to be in File search
but not in a search in a file.
Comment 19 Dani Megert CLA 2003-09-27 19:01:01 EDT
It is correct what you see. I20030925 is only a rebuild of I20030924 containing
fixes for the problems that appeared in that build. Either use N20030925 or
higher or wait for the next I-build.

I also added a link into the F1 help to get an overview of the regex language.
Comment 20 Douglas Pollock CLA 2003-10-02 10:46:18 EDT
I'm not sure if this is a bug with the current implementation, but I'm having
problems with I20030930.  I'm doing a Find on a java source file -- looking for
commented out lines of source.  The search string is "^//" and "Search string is
a regular expression" is checked.  Escaping the sequence "^\/\/" -- as might be
required by sed -- also doesn't work.

Searches like ";$" also fail.

Is the implementation complete for I20030930?
Comment 21 Dani Megert CLA 2003-10-02 11:03:57 EDT
It's perl-like regex and should work. Just tested using \bword\b.
Next build will containt F1 help and probably content assist.
Comment 22 Nikolay Metchev CLA 2003-10-02 11:39:20 EDT
does the implementation in 20030930 support capturing groups. I.e putting \1 
\2 etc in the replace textbox. I tried it and it seems to put in 1 and 2 
instead of the actual capturing group! If it doesn't support capturing 
groups... should it?
Comment 23 Douglas Pollock CLA 2003-10-02 11:57:13 EDT
It would make it more useful if it did support groups.
Comment 24 Bob Foster CLA 2003-10-02 12:07:39 EDT
>It would make it more useful if it did support groups.

That's putting it mildly. I'm sure this is just a matter of syntax, that
something other than \1 is used to designate the group, or timing.

But just in case the obvious needs to be said, it would be completely
unacceptable not to support groups.
Comment 25 Dani Megert CLA 2003-10-02 12:16:02 EDT
It supports groups. You can use \aGroupNumber in the find string and
$aGroupNumber in the replace string. It should support \aGroupNumber in the
replace string as well. I have to check why the regex package isn't doing so.
According to its doc it should.
Comment 26 Dani Megert CLA 2003-10-07 04:49:22 EDT
Added F1 help and content assist support for regular expressions for
find/replace combos.

Available in builds >= I20031007
Comment 27 Dirk Baeumer CLA 2003-10-08 08:13:48 EDT
start verifying
Comment 28 Dirk Baeumer CLA 2003-10-08 08:21:53 EDT
verified.