Regexp text matching

I want to match the following string fromat and breakdown into an array

var str = "A123456 some text F unwaned text blabla A123457 another text string F";

into something like this

["A123456 some text F", "A123457 another text string F"]

Upvotes: 0

Views: 29

Answers (1)

falsetru
falsetru

Reputation: 369084

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"]

Upvotes: 1

Related Questions