SyntaxFix
Write A Post
Hire A Developer
Questions
Use match instead, and the g flag.
str.match(/<b>(.*?)<\/b>/g);