RegExp to isolate disc/track# leaves 0 and 0/0 untouched

I want for track# and disc# only no zero values w/o leading zeros, e.g.

0/0   → 
0     →
01/0  → 1
02/02 → 2
1     → 1
2     → 2
3 34  → 3

But using

^[\s0]*([1-9]\d*).*$ ⟶ $1

works for every example above (and a lot of others) besides “0/0” and “0”. These left unexpectedly untouched. The expression matches, but maybe the empty result for the only capturing group is the reason? I tried to circumvent this by

^([\s0]*)([1-9]\d*)(.*)$ ⟶ $2

no luck, currently I use a 2nd to clean up

^(0|0/0)$ ⟶ 

I’ m just curious what’s the reason may be, thanks.

You could also use $grtr($num(%track%,1),0)
or
$ifgreater($num(%track%,1),0,yes,no)

Oh, thanks, good suggestion — I was probably overly focused on regular expressions. This works in a single command.

$ifgreater($num(%track%,1),0,$num(%track%,1),)