in reply to how to loop through?
while(/<tc>/)
If you write the regexp as
/<tc ( [^>]+)? >/x [download]