Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » whole word file search(what flavor of regex is expected)
whole word file search [message #650385] Mon, 24 January 2011 17:12 Go to next message
Steve Cohen is currently offline Steve CohenFriend
Messages: 46
Registered: July 2009
Member
I have not, until now, attempted to use a Regular Expression in the file search dialog. My aim here is to do a simple whole word search which is not directly supported in this dialog. However, I'd always assumed but never tried using regular expressions for this. I'd like to find all instances of the word "ADDRESS". As the regular expression, I type in "\wADDRESS\w" and it returns all words containing "ADDRESS" - in other words, the word-boundary tags in my regex are being ignored.

Is this a bug in Eclipse or is it expecting the regex in some other flavor? Help documentation is silent on this issue.

Re: whole word file search [message #650409 is a reply to message #650385] Mon, 24 January 2011 18:08 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 1/24/2011 10:42 PM, Steve Cohen wrote:
> I have not, until now, attempted to use a Regular Expression in the file
> search dialog. My aim here is to do a simple whole word search which is
> not directly supported in this dialog. However, I'd always assumed but
> never tried using regular expressions for this. I'd like to find all
> instances of the word "ADDRESS". As the regular expression, I type in
> "\wADDRESS\w" and it returns all words containing "ADDRESS" - in other
> words, the word-boundary tags in my regex are being ignored.
You should try "\WADDRESS\W" (uppercase W). \w (lowercase) matches word
characters (letters, digits, and underscores).
>
> Is this a bug in Eclipse or is it expecting the regex in some other
> flavor? Help documentation is silent on this issue.
>
>
Re: whole word file search [message #657145 is a reply to message #650385] Tue, 01 March 2011 17:55 Go to previous message
No real name is currently offline No real nameFriend
Messages: 1
Registered: March 2011
Junior Member
Try \b<word>\b as the regular expression. Works like a charm.
Previous Topic:Launcher finds Sun VM instead of IBM VM on Windows.
Next Topic:Widget is disposed error in TableViewer
Goto Forum:
  


Current Time: Tue Apr 23 09:50:18 GMT 2024

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

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

Back to the top