How to rename a pattern of "-[random string of characters]"?
Hello. I'm still a bit of a newbie when it comes to regex and AdvancedRenamer itself.
I'm trying to rename some files, for example [1964 Chad Valley Doctor Who Part 2-Oq-T2tyN-AI] and [Doctor Who - Zoe's Happiness-1taJtPsaUJc]. As you can see, after the title itself, there's a - and some jumbled characters, that range from letters (capital or lowercase), numbers and more -.
I'm trying to find a way to take those out and I can't seem to push my brain to reach a solution.
Any help appreciated,
John
I'm trying to rename some files, for example [1964 Chad Valley Doctor Who Part 2-Oq-T2tyN-AI] and [Doctor Who - Zoe's Happiness-1taJtPsaUJc]. As you can see, after the title itself, there's a - and some jumbled characters, that range from letters (capital or lowercase), numbers and more -.
I'm trying to find a way to take those out and I can't seem to push my brain to reach a solution.
Any help appreciated,
John
Try...
Replace: [^ ]\K-[^\]]*
With: nothing
Use regular expressions
Replace: [^ ]\K-[^\]]*
With: nothing
Use regular expressions
Reply to #2:
Thank you so much, worked like a charm!
Thank you so much, worked like a charm!
Reply to #2:
... or if you don't want to retain the square brackets...
Replace: \[?(.*?[^ ])-.*
With: \1
This Regex will work on filenames either with or without the brackets.
... or if you don't want to retain the square brackets...
Replace: \[?(.*?[^ ])-.*
With: \1
This Regex will work on filenames either with or without the brackets.