JSFiddle - React, Tailwind, and code Playground
by algotree
HTML
<!DOCTYPE html>
<html>
<body>
<h1>Extract numeric strings using match() function</h1>
<h2>match() searches for a matching regular expression.</h2>
<label id="id_str" name="name_str">This_string_111_contains_23_foo33.44bar5_6.7_and_554.44.55_some444_random_numeric_90values</label>
<br><br>
<label>Extacted numeric values: </label>
<p id="numeric_values"></p>
</body>
</html>
JavaScript
let text = document.getElementById("id_str").textContent;
let result = text.match(/\d+(\.\d+)?/g);
document.getElementById("numeric_values").innerHTML = result;