Correct way to loop through all the regex matches (woops)