<script> a='something([findthis(something'; regex= /(\[+([A-Za-z0-9])+)+/g; b=a.match(regex); document.write(b); </script>