How to modify a macro to batch rename macro groups instead of macros

in July 2023, @cfriend added a very useful macro (below) to the library to batch search replace rename macros. I use if often

I am currently reorganizing and renaming my macro groups, renaming them about 20 macro groups at a time (I have many).

Is there a way to modify the macro to allow me to rename search replace macro groups instead of macros ?

thanks in advance for your time and help

[KM] Rename Macros with RegEx S&R.kmmacros (7.1 KB)

batch rename macros (click to expand/collapse)

Something like this?

Group Regex Rename.kmmacros (3.2 KB)

Image

It's working for me -- but I won't pretend to have tested against every conceivable macro group name, so use with caution until you are happy with it.

1 Like

I will do multiple backups and test your macro. thanks very much !!

I want to delete the first 3 characters of each selected macro with your excellent macro.
The following does not work. Would you have any idea why ? My regex must be wrong.
thank you very much

^.{3}
replace with nothing

neither does this

(?m)^\d{3}\)

The first one should work, as long as you leave the "Replace" field blank so you are replacing the first three characters with an empty string:

1 Like

that's exactly what I did. I don't understand. thank you
is there any reason why it would not work with 12)abc and work fine with 12) abc ?
thank you very much

Both work fine here (remembering that the first probably needs ^.{3} for the search term, the second ^.{4}.

Otherwise, it's difficult to say until you explain what you mean by "would not work".

1 Like