Sublime Forum

Replace using Preserve Case

#1

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’ :question:

0 Likes

#2

You should not be using preserve case. Use the “case sensitive” instead.

0 Likes

#3

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.

0 Likes

#4

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.

0 Likes