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.