This works great to change from: (1) to (Part 1)
Code: Select all
.replacePart(' (Part $1)'))
I've tried: .pad(2), but that didn't work, I would assume as the .replacePart, isn't a string to attach it too.
Thanks,
-Dev
Code: Select all
.replacePart(' (Part $1)'))
Code: Select all
{'Test (1)'.replaceAll("\\s*[(]([^)]*)[)]\$", { group, match -> ' '+match.pad(2) })}
Hi DevXen.
Code: Select all
{n} - {s00e00} - {t.replaceAll("\\s*[(]([^)]*)[)]\$", { group, match -> ' (Episode '+match.pad(2)+')' })}
Code: Select all
{n} - {S00E00} - {t.replaceAll(".*Episode ([1-9])\$", { group, match -> 'Episode '+match.pad(2) })}