Contact: aviboots(AT)netvision.net.il
38,119 questions
49,726 answers
573 users
const text = "The price is 148.95 dollars"; const floatRegex = /[-+]?\d*\.\d+|\d+/; const match = text.match(floatRegex); if (match) { const number = parseFloat(match[0]); console.log("Extracted float:", number); } /* run: Extracted float: 148.95 */