Erm, sorry. If you use the $regsubex method, it can be simply:

alias numonly return $regsubex($1-,/[^0-9]/Sg,)

I just realized it should have been that way, however it will work either way. Though, in this one I added the S modifier to strip text before matching (in the off chance that your var contains colors).

If you wish to learn regex, hixxy has a pretty good tutorial: here to get you started if you haven't already looked through it.