JSFiddle - React, Tailwind, and code Playground

HTML

<span id="output">Text</span>

JavaScript

var str = 'budgets-closed';
var matches = str.match( /\b([^-]+)-([^-]+)\b/ );

var before = matches[1];
var after = matches[2];

$("#output").text(before + " " + after);