JSFiddle - React, Tailwind, and code Playground

JavaScript

var og = "-123.456abcdefgfijkl";
var updated = og.match(/\d/g);
console.log(updated);