I apologize if this is a repeat question, but I couldn't find anything using advanced search.
I asked the RegEx assistant, the following:
I gave the BRU AI the following challenge:
My movie folders each contain a movie and it's related sidecar files. I want to rename the base name of all the content files to the folder name.
This is a sample movie folder name:
"Some Old Movie (1936)\"
This is a sample of folder content:
"
[i]SomeMovie (1936).English.srt
SomeMovie (1936).mp4
SomeMovie (1936)-mediainfo.xlm
SomeMovie (1936)-portrait.jpg
SomeMovie (1936)-trailer.mp4[/i]
"
Notice how the movie sub-folder and the base file name each end in in a year enclosed in parentheses "\(\d{4}\)". This will make identifying the titles easy.
Here are the results I expected:
"
[i]SomeMovie (1936).English.srt ? Some Old Movie (1936).English.srt
SomeMovie (1936).mp4 ? Some Old Movie (1936).mp4
SomeMovie (1936)-mediainfo.xlm ? Some Old Movie (1936)-mediainfo.xlm
SomeMovie (1936)-portrait.jpg ? Some Old Movie (1936)-portrait.jpg
SomeMovie (1936)-trailer.mp4 ? Some Old Movie (1936)-trailer.mp4
[/i]"
I've tried the following in regular expressions RegEX(1) on the advice of the BRU assistant from an earlier visit:
Match: "^.*?(\(\d{4}\))(.*)$"
Replace: "<folder>$2"
These are my actual results:
"
SomeMovie (1936).English.srt ? Some Old Movie 1936.English.srt
SomeMovie (1936).mp4 ? Some Old Movie 1936.mp4
SomeMovie (1936)-mediainfo.xlm ? Some Old Movie 1936-mediainfo.xlm
SomeMovie (1936)-portrait.jpg ? Some Old Movie 1936-portrait.jpg
SomeMovie (1936)-trailer.mp4 ? Some Old Movie 1936-trailer.mp4
"
Please note that the parentheses have been removed in the results. Why are they removed and how can I correct it at the same time as the rename task runs? When I asked the assistant again, I explained this error and asked why it happened and how to correct it at the same time as the rename. The RegEx assistant did a deep think and basically told me it should work, that I probably had a filter or translation removing the parentheses.
I did a reset and typed in the regex stuff again. When I tried running it again, the date portion still DID NOT include the parentheses. I searched through all the settings to verify I had no filters or translations that got missed. Nothing explains this. I have used the RegEx assistant several times and it is usually spot on in its recommendations.
I tried using "Append Folder Name(9)" and the appended name DOES INCLUDE the parentheses. This is not ideal since it would leave me an additional renaming task to perform to make the sidecar files correct again.
Can anyone on the development team explain why this happens and a work around for it?
Also, I searched the manual and the Expert's corner manual and found no mention of using <folder> at all. Did I mess that? Where did the assistant get that information?
Thank you for your time and effort!
Have a good day.