var text = 'This note is created on [date] by [admin;operator] for [[]]' var myArray = text.match(/[([^[]*)]/g); console.log(myArray);