I was trying to get integer from below string and convert it again replace it . Need regex pattern to get mtr, km array from string. Little help will be highly appreciated.
let stringText = "Please continue for 290 m. And then take left and continue for 1.2 km.";
console.log(stringText);
let mtr_pattern = "";
let kn_pattern = "";
let numArr = stringText.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g) || []);
numArr = numArr.filter(n => n != '.');
console.log("numArry", numArr);
output should be : Please continue for 0.18 miles. And then take left and continue for 0.74 miles