const text = "The price is 148.95 dollars";
const floatRegex: RegExp = /[-+]?\d*\.\d+|\d+/;
const match: RegExpMatchArray | null = text.match(floatRegex);
if (match) {
const number = parseFloat(match[0]);
console.log("Extracted float:", number);
}
/*
run:
"Extracted float:", 148.95
*/