$replace($regexp(%TITLE%,'^(\d+) (.+)$','$1-{{1}} $2'),'{{1}}',%TRACK%)
From:
003 Aria Hier ist das
To:
003-01 Aria Hier ist das
Where do all the values come from?
ARTIST: Bach
???: 003
???: Ril
TRACK: 01
???: Aria
???: Hier ist das...
Are these values stored already in tag fields?
If so you can compose your TITLE string from the values out of the other tag fields.
Otherwise it would be a bit more difficult to create your format.
The string "Bach: " has to be prepended. Easy.
The string " [Ril] " has to be inserted by replacing "-" within the numbers "003-01". Easy.
Because the word "Aria" has to be encountered as an one word exception there is an unknown series of words from the tail which have to be enclosed with curly brackets. Problematic.
All of the information is in the title field (the same as filename), so some ideal end format examples would be:
Bach: 048 [Ril] 01 Coro {Ich elender Mensch, wer wird mich erlosen}
Bach: 048 [Ril] 02 Recitativo (A) {O Schmerz, o Elend, so mich trifft}
Bach: 048 [Ril] 03 Choral {Solls ja so sein, dass Straf und Pein}
Bach: 048 [Ril] 04 Aria (A) {Ach lege das Sodom der sundlichen Glieder}
But there are about 80 discs that I ripped and CDDB fills in the titles in various ways, such as:
22 BWV 187; Aria (S)_ Gott versorget alles Leben
01 Tˆnet, ihr Pauken! Erschallet, Trompeten! BWV 214 No. 1 Coro - Tˆnet, ihr Pau...
15 Bach_ 212 [Ril] 3 Recitativo (S_B)_ Nu, Mieke, gib dein Guschel immer her
Its a complete mess. So I wrote some replace and add and subtract actions to get it to a more manageable file name/title format. But I realize that automation will be out of the question.