Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Negative search
Negative search [message #330547] Fri, 01 August 2008 07:36 Go to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Does anyone know how (or if it is possible at all) to do a negative file
search (e.g. find all .java files that do *not* contain the word "foo")
in Eclipse?

Cheers,
Dimitrios
Re: Negative search [message #330548 is a reply to message #330547] Fri, 01 August 2008 07:51 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090801060609010906000400
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Cannot regexes do the trick? "Search => Files..." tick "regular
expression" and search for "\A[^\Qfoo\E]*\Z" while setting the file
filter to *.java.

This seems a little "overkill" for such a task, but I think this would
work as expected.

Regards

Laurent Goubet
Obeo

Dimitrios Kolovos a
Re: Negative search [message #330550 is a reply to message #330548] Fri, 01 August 2008 08:08 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Laurent,

Thanks for your reply! I was hoping they would but I can't seem to get
them working. Instead, I've scribbled a "Negative Search Engine" by
changing the locateMatches method of (a copy of) the
org.eclipse.search.internal.core.text.TextSearchVisitor class (in case
anyone else is interested) and this seems to do the trick.

Cheers,
Dimitrios

laurent Goubet wrote:
> Hi,
>
> Cannot regexes do the trick? "Search => Files..." tick "regular
> expression" and search for "\A[^\Qfoo\E]*\Z" while setting the file
> filter to *.java.
>
> This seems a little "overkill" for such a task, but I think this would
> work as expected.
>
> Regards
>
> Laurent Goubet
> Obeo
>
> Dimitrios Kolovos a écrit :
>> Hi,
>>
>> Does anyone know how (or if it is possible at all) to do a negative
>> file search (e.g. find all .java files that do *not* contain the word
>> "foo") in Eclipse?
>>
>> Cheers,
>> Dimitrios
>
Previous Topic:correct way to open editors of various "types" (i.e., to create an EditorInput?)
Next Topic:Minimize the editor Area does not work on all PCs ?
Goto Forum:
  


Current Time: Sun Dec 22 06:04:04 GMT 2024

Powered by FUDForum. Page generated in 0.03487 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top