Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Maintaining capitalization with Find & Replace
Maintaining capitalization with Find & Replace [message #209888] Thu, 11 March 2004 15:55 Go to next message
Eclipse UserFriend
Hey, all. I was wondering if there's a way to Find & Replace smartly wrt
capitalization. Example: I want to replace all instances of Network and
network with Platform and platform (respectively). How can I do this with
one F&R?
Re: Maintaining capitalization with Find & Replace [message #209901 is a reply to message #209888] Thu, 11 March 2004 16:14 Go to previous messageGo to next message
Eclipse UserFriend
David wrote:

> Hey, all. I was wondering if there's a way to Find & Replace smartly wrt
> capitalization. Example: I want to replace all instances of Network and
> network with Platform and platform (respectively). How can I do this with
> one F&R?


Click on "Case Sensitive" under Options in the Find/Replace dialog.
Re: Maintaining capitalization with Find & Replace [message #209910 is a reply to message #209901] Thu, 11 March 2004 16:11 Go to previous messageGo to next message
Eclipse UserFriend
If I do that, then it will only find "Platform" and not "platform". I
want Case Insensitive but I want the letters that were capitalized to stay
capitalized, and the letters that were lower case to stay lower case.

R.U. Deranged wrote:

> David wrote:

> > Hey, all. I was wondering if there's a way to Find & Replace smartly wrt
> > capitalization. Example: I want to replace all instances of Network and
> > network with Platform and platform (respectively). How can I do this with
> > one F&R?


> Click on "Case Sensitive" under Options in the Find/Replace dialog.
Re: Maintaining capitalization with Find & Replace [message #209941 is a reply to message #209910] Thu, 11 March 2004 17:00 Go to previous messageGo to next message
Eclipse UserFriend
Then do two Find/Replace operations instead of one. ;-)

A regular expression in the Find field will easily find what you need, for
example:

[ ][Pp]latform

and you could even use brackets to capture and store the case of the letter,
but only for use in the string the regex is currently parsing. I don't
think Eclipse lets you pass captured strings as parameters from the Find
regex to the Replace regex. That would be a great feature though.


David wrote:

> If I do that, then it will only find "Platform" and not "platform". I
> want Case Insensitive but I want the letters that were capitalized to stay
> capitalized, and the letters that were lower case to stay lower case.
>
> R.U. Deranged wrote:
>
>> David wrote:
>
>> > Hey, all. I was wondering if there's a way to Find & Replace smartly
>> > wrt
>> > capitalization. Example: I want to replace all instances of Network
>> > and
>> > network with Platform and platform (respectively). How can I do this
>> > with one F&R?
>
>
>> Click on "Case Sensitive" under Options in the Find/Replace dialog.
Re: Maintaining capitalization with Find & Replace [message #209949 is a reply to message #209941] Thu, 11 March 2004 17:02 Go to previous messageGo to next message
Eclipse UserFriend
> [ ][Pp]latform

Oops, typo. That should be:

[ ][P|p]latform
Re: Maintaining capitalization with Find & Replace [message #209957 is a reply to message #209941] Thu, 11 March 2004 17:05 Go to previous messageGo to next message
Eclipse UserFriend
Eclipse is supposed to allow you to pass captured strings as parameters,
but I haven't figured out the way to actually do it. You should be able
to do this (note that Eclipse seems to use "(" and ")" as capture blocks,
as opposed to "\(" and "\)") when Regular expressions box is checked:
Find: ([Pp])latform
Replace: \1roduct

Even if I could get this to work, it would only be ok for words that start
with the same letter, and not much help in general. Note that I'm getting
most of my info through hitting CTRL-Space in the Find: and Replace:
fields.

R.U. Deranged wrote:

> Then do two Find/Replace operations instead of one. ;-)

> A regular expression in the Find field will easily find what you need, for
> example:

> [ ][Pp]latform

> and you could even use brackets to capture and store the case of the letter,
> but only for use in the string the regex is currently parsing. I don't
> think Eclipse lets you pass captured strings as parameters from the Find
> regex to the Replace regex. That would be a great feature though.


> David wrote:

> > If I do that, then it will only find "Platform" and not "platform". I
> > want Case Insensitive but I want the letters that were capitalized to stay
> > capitalized, and the letters that were lower case to stay lower case.
> >
> > R.U. Deranged wrote:
> >
> >> David wrote:
> >
> >> > Hey, all. I was wondering if there's a way to Find & Replace smartly
> >> > wrt
> >> > capitalization. Example: I want to replace all instances of Network
> >> > and
> >> > network with Platform and platform (respectively). How can I do this
> >> > with one F&R?
> >
> >
> >> Click on "Case Sensitive" under Options in the Find/Replace dialog.
Re: Maintaining capitalization with Find & Replace [message #210049 is a reply to message #209910] Thu, 11 March 2004 17:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

David wrote:
> If I do that, then it will only find "Platform" and not "platform". I
> want Case Insensitive but I want the letters that were capitalized to stay
> capitalized, and the letters that were lower case to stay lower case.
>
> R.U. Deranged wrote:
>
>
>>David wrote:
>
>
>>>Hey, all. I was wondering if there's a way to Find & Replace smartly wrt
>>>capitalization. Example: I want to replace all instances of Network and
>>>network with Platform and platform (respectively). How can I do this with
>>>one F&R?
>
>
>
>>Click on "Case Sensitive" under Options in the Find/Replace dialog.
>
>
>

In case you didn't read my post on "replace, emacs-style".
Just some info.
I think both Xemacs and JEdit have the behaviour you are asking for.
This may be a hint that this behaviour is a quite practical feature.

Regards,
Peter
Re: Maintaining capitalization with Find & Replace [message #210071 is a reply to message #209888] Thu, 11 March 2004 18:00 Go to previous message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Please submit bug/RFP - I'll vote definitely.

PS. MSWord had this long ago - very convenient.
--
Sam Mesh - http://openrules.com
Previous Topic:javai.dll was not found and JVM terminated
Next Topic:source builds building
Goto Forum:
  


Current Time: Fri May 16 18:42:56 EDT 2025

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

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

Back to the top