Negative search [message #330547] |
Fri, 01 August 2008 07:36  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.02573 seconds