That works fine for what it is meant to do. If you have the following as the %string-
<span class="title">text1</span><span class="title">text2</span><span class="title">text3</span>
And then use that $regex, then:
$regml(title,1) = text1
$regml(title,2) = text2
$regml(title,3) = text3
If you give us your %sting that has 8 matches in it, we can tell you if there's an issue.