JSFiddle - React, Tailwind, and code Playground
JavaScript
var regex = /(\w+)?(\([^\)]*?\)|\[[^\]]*?\])(\w+)?|\w+/g;
console.log( 'Some(1) text [more text]'.match(regex) );
console.log( '(2) Some text[more text]'.match(regex) );
console.log( '(3 45)Some text[more text]'.match(regex) );