var re=/][a-z]+/g; var s= "[attach]1[/attach]aaaaaa[attach]2[/attach]bbbbb"; console.log(s.match(re)); 转载请注明:谷谷点程序 » js match 正则匹配