Ñhosko
Ñhosko

Reputation: 795

How to search and replace and keep case in Notepad++?

Is it possible to search and replace a string using Notepad++ and keep the case (small or big caps) formatting?

For example, I have the following strings that are often used in several files:

UserLogin
USERLOGIN
userlogin

Now, I need to name everything "consumer" instead of "user". Like this:

ConsumerLogin
CONSUMERLOGIN
consumerlogin

Is there anyway of doing this change with only 1 search/replace in Notepad++? Or I have to do 3 different search/replace?

Upvotes: 5

Views: 1168

Answers (1)

Stocki
Stocki

Reputation: 473

I think you have to do 3 search/replace, but you can create a macro to "group" them. Start a macro, do the 3 replaces then stop the macro. (Macro > Start/Stop Recording). Click Macro > Save Currently Recorded Macro and choose a Name and Shortcut for later uses.

I hope it helps!

Upvotes: 1

Related Questions