Indicate a character that has an incremental pattern

I'm trying to do a replace action by inserting a zero before any track number that's lower than 10. These are vinyl rips, so every track name either starts with an A or B depending on which side of the record they're on.

I want the zero to go between the A or B and the track number. However if the track name also has an A or B it gets an unwanted zero added to it and I have to manually delete those.

This is a similar question to what I asked yesterday, but what is the code to only effect one instance of the character I want to change?

Also is there a batch process I can use to put a zero in front of only numbers 1-9, but exclude the zero from 10 or higher?

Try the function $num(Number_expression,2) which outputs 2-digit numbers.

Are you talking about the field TITLE or the filename?
Could you give us an example of the A or B tag data, what it looks like now and what it should look like?

[quote=" [ohrenkino]"]
Are you talking about the field TITLE or the filename?
Could you give us an example of the A or B tag data, what it looks like now and what it should look like?[/quote]

It's in the filename column. Here's the file list in mp3tag without zeros on tracks A1-A9 and B1-B9:

And here is the same list with those files with a zero between the starting letter and single digit number:

This is essentially what I want the finished list to look like.

The official spec for TRACK is to be a number only. Some file types tolerate if you add a letter like A1 or A01, but others like m4a will not allow it.

Thank you for the screenshots.

As the filename is no tag but a property that is only required by the filename, It would come in handy to see what the field TRACK looks like and the format string with which you create the filename from tags.

Here's the same list with the TRACK field included:

These are the strings used to create the filenames for this album:
For the A side
A$num(Number_expression,)$cutleft(%_filename%, 1)

For the B side
B$num(Number_expression,)$cutleft(%_filename%, 1)

This would have to become A$num(%track%,2)

I'm not putting A1, A2, B1, B2, ect. in the track field. Only at the beginning of filenames. I'm keeping the track field strictly numerical.

OK that makes it easier to work with. Is there a field you are using to store the album side info? Or is this a manual process only? Just trying to figure out how to automate this easier for you.

That's what I wanted. Thank you.