JSFiddle - React, Tailwind, and code Playground

by mowglisanu

JavaScript

var result = "-5. -2 3.1415 test 2.4".match(/[-+]?\d*(\.(?=\d))?\d+/g);
alert(result);
result = "-5. -2 3.1415 test 2.4".match(/[-+]?\d*(\.\d+)?/g);
alert(result);