Here is something I have been using for quite some time and it works perfectly. Probably a cleaner method out there but it works and thats what matters
.
This deals with the total disks.
Begin Action Group Format 1#TOTALDISKS %Discnumber%
Action #1
Actiontype 5: Format value
Field: TOTALDISKS
Formatstring: %discnumber%
Action #2
Actiontype 4: Replace with regular expression
Field: TOTALDISKS
Regular expression: ^\d/(\d+)$
Replace matches with: $1
[_] Case sensitive comparison
End Action Group Format 1#TOTALDISKS %Discnumber% (2 Actions)
It fill the total disk to the track and vice versa.
Begin Action Group Format 1#TRACK %Track%%Totaltracks%
Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d)$
Replace matches with: 0$1
[_] Case sensitive comparison
Action #2
Actiontype 5: Format value
Field: TRACK
Formatstring: %track%/%totaltracks%
Action #3
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d+)/(\d+)/(\d+)$
Replace matches with: $1/$3
[_] Case sensitive comparison
Action #4
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: /+$
Replace matches with:
[_] Case sensitive comparison
Action #5
Actiontype 5: Format value
Field: TOTALTRACKS
Formatstring: %track%
Action #6
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^\d+/
Replace matches with:
[_] Case sensitive comparison
Action #7
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^/\d+
Replace matches with:
[_] Case sensitive comparison
Action #8
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^/
Replace matches with:
[_] Case sensitive comparison
End Action Group Format 1#TRACK %Track%%Totaltracks% (8 Actions)
Optional (Add leading zeros track + Totaltrack)
Begin Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros
Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d)(/\d+)$
Replace matches with: 0$1$2
[_] Case sensitive comparison
Action #2
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d{0,4})/(\d{1})$
Replace matches with: $1/0$2
[_] Case sensitive comparison
Action #3
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^(\d)$
Replace matches with: 0$1
[_] Case sensitive comparison
End Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros (3 Actions)
Format_1_TOTALDISKS__Discnumber_.mta (150 Bytes)
Format_1_TRACK__Track__Totaltracks_.mta (365 Bytes)
Format_1_TRACK___TOTALTRACK_Add_Leading_Zeros.mta (170 Bytes)