Zero Padding Numbers Scripts?

Does anyone have any good scripts that have been tested as a button for opus that does zero padding in numbers?

Depends what you mean, exactly.

Please give some examples.

I was interested in having a button that would run a script that would zero pad to two digits any number to the left in a file name:

example:

Fred Saberhagen - Book 1 - Starship Vector.epub ===> Fred Saberhagen - Book 01 - Starship Vector.epub
Fred Saberhagen - Book 01 - Starship Vector.epub ===> Fred Saberhagen - Book 01 - Starship Vector.epub (stays the same)
Fred Saberhagen - Book 10 - Starship Vector.epub ===> Fred Saberhagen - Book 10 - Starship Vector.epub (stays the same)

You can do that with a regex:

Old name: (.* )([0-9])( .*)#
New name: \10\2\3

Or, if you're using VBScript's RegExp object (see the example in the rename scripting area):

re.Pattern = " ([0-9]) "
strNameOnly = re.Replace(strNameOnly, " 0$1 ")