let str = '(234234)345234532452345((2123123123234234)))))))))))(234234234234)' let reg = /[\(]+(.*?)[\)]+/gm str.replace(reg, (match, p1)=>{ console.log(p1) })