JSFiddle - React, Tailwind, and code Playground

by alpacalips

JavaScript

var str = "2431-72367";
var result = str.match(/\d+-\d+/);
alert(result);