JSFiddle - React, Tailwind, and code Playground
HTML
<div id="output"></div>
JavaScript
var remote, source;
remote = 'budgets-closed';
if (remote.match(/^[a-z]+/g) == 'budgets') {
source = '/panel/budgets/data/' + remote.match(/\-(\w+)/g);
}
$('#output').html(source);