#1 : 12/05-20 18:44
I have thousands of files i need to replace and I'm having an issue where it's replacing things i don't want to replace.
Below is an examples.
example of file names;
I need help to replace the last number and dash "-1" with _black, but at the same time, it should not replace -12 with _black2.png or -123 with _black23.png, but should replace -1_c with _black_c.
#2 : 12/05-20 23:52
Text to be replaced: .*-.*-.*\K-\d([^\d]|$)
Replace with: _black\1
Use regular expressions
This works with all your examples but assumes that the "-1" you wish to replace is always the 3rd dash in the filename.
#3 : 13/05-20 17:24
Reply to #2:
Sorry - I posted the wrong regular expression. That one will replace a hyphen followed by ANY single digit with "_black"
so 5443-110-4533-2 -> 5443-110-4533_black
To replace ONLY "-1" use: .*-.*-.*\K-1([^\d]|$)