JSFiddle - React, Tailwind, and code Playground
by unilecs
JavaScript
const title = 'Some text ** New Title ** Some text';
console.log(title.replace(/^(.*?\*\*)\s*(\b.*)\b\s+(\*\*.*)$/, '$1$2$3'));
by unilecs
const title = 'Some text ** New Title ** Some text';
console.log(title.replace(/^(.*?\*\*)\s*(\b.*)\b\s+(\*\*.*)$/, '$1$2$3'));