Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 981
Ñhosko Avatar asked Nov 11 '22 21:11

Ñhosko


1 Answers

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!

like image 155
Stocki Avatar answered Nov 15 '22 04:11

Stocki