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