var word="[hell]还能行吗[world]" var rep=/(\[[a-z]+\])/g; //console.log(word.match(rep)); console.log(word.replace(rep,''))
result: 还能行吗