in reply to Re: Perl Golf - Renaming MP3s
in thread Perl Golf - Renaming MP3s

And if the track number is more than 2 digits?

Update: Oops! It seems that I didn't read the challenge carefully.
buzzcutbudda specified that the track number would only be two digits.
Thanks for the heads up, nothingmuch.

Replies are listed 'Best First'.
Re: Re: Re: Perl Golf - Renaming MP3s
by nothingmuch (Priest) on Nov 18, 2002 at 22:51 UTC
    I think I would go for ()=/\d+-(.*)/g

    -nuffin
    zz zZ Z Z #!perl
Re: Re: Re: Perl Golf - Renaming MP3s
by theorbtwo (Prior) on Nov 19, 2002 at 01:58 UTC

    The id3v1 spec only has space for a two-digit track number. (IIRC, theoreticaly, you could put any two characters in, so you could count in hex, base-36, or whatever if you need more space, up to a theoretical max of 254**2, with any two chars, other then \0, which probably has special meaning. I don't remember id3 that well off the top of my head.)


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re: Re: Re: Perl Golf - Renaming MP3s
by ichimunki (Priest) on Nov 19, 2002 at 02:31 UTC
    I believe it's the case that the CD spec itself limits a disc to 99 tracks anyway.