const solution = string => parseInt(string.match(/[0-9]/g).join('')); const result = solution('g0en2T0s8eSoft'); console.log(result);