Skip to main content



      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 12:12 Go to next message
Eclipse UserFriend
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 13:08 Go to previous messageGo to next message
Eclipse UserFriend
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 12:55 Go to previous message
Eclipse UserFriend
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 Jul 01 12:58:40 EDT 2025

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

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

Back to the top