Maintaining capitalization with Find & Replace [message #209888] |
Thu, 11 March 2004 15:55  |
Eclipse User |
|
|
|
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 #209957 is a reply to message #209941] |
Thu, 11 March 2004 17:05   |
Eclipse User |
|
|
|
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.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03636 seconds