Community
Participate
Working Groups
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.
+1
Defer to v3.
OT: Boris, if you wish to be able to vote for bugs, you may want to add yourself as a CC of bug 12115.
Reopen to investigate
*** Bug 19242 has been marked as a duplicate of this bug. ***
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.
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
v3 -> Eclipse 3.0
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.
*** Bug 33115 has been marked as a duplicate of this bug. ***
Done for Search. Moving to Text
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.
Perhaps you could use http://jakarta.apache.org/oro/index.html instead of the JDK 1.4x stuff?
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)
The implementation of regex support has started. Releasing the changes has to wait until the entire development switches to 1.4.
This is on the 3.0 M4 plan. Already implemented for File search.
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
I am using build I20030925, the regular expression seems to be in File search but not in a search in a file.
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.
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?
It's perl-like regex and should work. Just tested using \bword\b. Next build will containt F1 help and probably content assist.
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?
It would make it more useful if it did support groups.
>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.
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.
Added F1 help and content assist support for regular expressions for find/replace combos. Available in builds >= I20031007
start verifying
verified.