const res = '0.220Kb'.replace(/ *(-?(\.\d+|\d+(\.\d+)?)) */g, " $1 ").trim(); console.log(res.split(' '));