Remove all non-numeric values

To remove all non-numeric values (everything that is not a number) from a string with RegEx you can use the following pattern.

"12.99 €".replace(/[^\d+]/g, '');
// => 1299

[^\d+] tells the RegEx to match everything that does not start with a digit, e.g. every character that is not one of 0 1 2 3 4 5 6 7 8 9 resulting in the removal of all letters and special characters like $ or .

Below is a CodePen showing the result of executing the RegEx on different strings.

See the Pen a603afc1d48a5847cc93004028b32492 by Kevin Gimbel (@kevingimbel) on CodePen.