js remove everything but numbers code example Example: javascript remove all but numbers string.replace(/[^0-9]/g, '');