我希望将以下字符串格式与细分匹配到数组
var str = "A123456 some text F unwaned text blabla A123457 another text string F";
这样的事情
["A123456 some text F", "A123457 another text string F"]
答案 0 :(得分:1)
var str = "A123456 some text F unwaned text blabla A123457 another text string F";
str.match(/A.*?F/g)
// => ["A123456 some text F", "A123457 another text string F"]