JSFiddle - React, Tailwind, and code Playground

JavaScript

var text = '!!some text!!(zoomOn node1)';
text.replace(/(?:!!)(.+)(?:!!)(?:\(zoomOn )([\S,]+)(?:\))/g, function (match, innerText, nodeString) {
	alert("matched!")
})