Home Download Buy Blog Forum Support

Replace using Preserve Case

Replace using Preserve Case

Postby tgkeul on Wed Oct 20, 2010 9:38 pm

I have holidays and time programming in python. Nice, but what happens?

I want to change the class name 'NoteBook' and the variable name 'noteBook' into 'Notes', respectivly 'notes'
In the replace panel 'Find what:' becomes 'Notebook', 'Replace with:' becomes 'Notes'
Options activated are 'Wrap search', 'Highlight Matches', 'Preserve case'

Activating 'Replace all' results in 'NoteBook' becoming 'NoteS', 'noteBook' becoming 'noteS'

This is obviously not what I wanted, but what I defined.

My Question: Is there a possibility getting 'Notes' respectivly 'notes' :?:
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: Replace using Preserve Case

Postby jhawk28 on Thu Oct 21, 2010 3:42 pm

You should not be using preserve case. Use the "case sensitive" instead.
jhawk28
 
Posts: 26
Joined: Sat Jun 13, 2009 2:17 pm

Re: Replace using Preserve Case

Postby tgkeul on Thu Oct 21, 2010 6:12 pm

Hmm, using "case sensitive" I have to perform 2 replacements, one for 'NoteBook' and one for 'noteBook'.

I hoped to avoid this using "preserve case" and avoiding to think about a regular expression. I was lazy.
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: Replace using Preserve Case

Postby jps on Fri Oct 22, 2010 12:39 am

Preserve case is the right thing to use here, but it's not as smart as it really should be... it's on the todo list.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 24 guests