See examples below. The first removes everything but integers. The second allows for decimal numbers (assuming period as delimiter).
Formatted numerics such as dates or scientific notation require a little more complex search string.
pi=":3b@./14Q15%9";
num(Regex(pi, "[^0-9]+", "", Globalreplace));
num(Regex(pi, "[^0-9.]+", "", Globalreplace));
Edit: just learned this has posted before. See Craige's excellent post in this thread Extract numbers from string in JSL