I have a series of files that have this format:
01x05e - Some text (Some more text)
01x05f - Some text (Some more text)
01x05g - Some text (Some more text)
What I'd like to to is strip them to produce this:
01x05e - Some more text
01x05f - Some more text
01x05g - Some more text
To do this, I am using the Bulk Rename Utility. I thought I had some regex I could use to do this:
-.*?\(
This successfully matches everything between the "-" and the "(" above. I was hoping I could use it to remove all of that text, before asking the Bulk Rename Utility to do a very trivial removal of the final character in every filename (i.e. the ")").
However, in Bulk Rename Utility I can't just match the text and replace it with no content to remove it. Instead, I have to specify a replace criteria and nothing I'm entering seems to be working. Any time I enter any data in the "replace" section it simply erases all of my filename.
This leads me to think I need to approach the regex differently and find some way of grabbing the data before the "-" and grabbing the data between both "(" and ")" and placing them together.
However, I've no idea how to even start doing this. Is this the correct approach, or am I missing something obvious with regards to the match and replace of the regex I currently have?
The Bulk Rename Utility has a support website, including a forum that features a section providing regex rename support, here.
It seems like you want to capture from the first paren (open) to the last paren (close) and delete everything after the first hyphen. Capturing groups are your friend here:
^([^-]* -) - This will match from start to first hyphen after space.
[^(]* - This will match everything except open paren.
\((.*)\)$ - This will match things inside the parens.
You can put it all together:
^([^-]* -)[^(]*\((.*)\)$
And replace it with just the first group and the last group:
\1 \2