in reply to Many matches to an array

In addition to the /g modifier to get more than one match you might want to turn your (.+) pattern into (.+?) so it will not match everything between the first div and the last /div in $content.