JSFiddle - React, Tailwind, and code Playground

HTML

<p id="in" style="white-space:pre;">1
1,99
1.99
10
100
5 999
2 USD
$2,99
Our price 2.99
Price: $ 20
200 $
20,-
6 999 USD
</p>

<p id="out" style="white-space:pre;">
    
</p>

JavaScript

var input = document.getElementById("in").innerHTML;
var out = input.replace(/[^0-9\.,\n]|,[^0-9]/g, "");
document.getElementById("out").innerHTML = out;