Batch edit current title

Hi,

I’m trying to edit the actual title to put a new one according to a regex.
For example: actual title is “Show - S01E01 - Episode title” and I want to only keep the “Episode title” part.

I was thinking about something like that:

set "mkv=C:\whatever\mkvpropedit.exe"
for /R "C:\whatever" %%F
in (*.mkv)
set originalTitle=??? #(I don't know…)
set regex=(^[^-]*- [^-]*- ) #I'm not sure how to store regex in bat files
set newTitle=${originalTitle:regex} #trying to remove the regex part
do "%mkv%" "%%F" --edit info --set title="@%newTitle%"

Well… As you can see I’m a newbie with bat files and I don’t know how to get current title of the file too…
Thank you in advance for your help!

Not particularly well-versed in bat file syntax. But in node.js this will be easy…
e.g. const newTitle = originalTitle.replace(/\w+ - S\d{2}E\d{2} - /, '')

Well I’m more familiar with JS too but can I run mkvpropedit with JS?

And is there a way to get current title of the file? :thinking: