Serharliree
New Member
I am trying to find a way to retrieve all the results returned from a \[code\].match()\[/code\] the HTML i work with now is:\[code\]<div> <span> one something 1 $2502 </span><br /> <span> one something 2 </span><br /> <span> one something 3 $25102 </span><br /></div>\[/code\]My match pattern is :\[code\]var priceArr = completetext.match(/>([^<>]*\$\s*(\d+\.?\d+)[^<>]*)</g);\[/code\]which basically catch both the first span and the last span. however it only retrieve the first group \[code\]()\[/code\] into priceArr.How can i iterate through the results like i normally would using \[code\]preg_match_all\[/code\] in phpThanks.