you're trying to find data in a specific tag, try this:
HTML:
<td><span class="link">
(there are whitespaces here) 78 (there are whitespaces here)
</span></td>
$string='<td><span class="link">
(there are whitespaces here) 78 (there are whitespaces here)
</span></td>';
$class='link';
$reg='<span(.|\s)*?class=(\'|")'.$class.'(\'|")[^>]*>((.|\s)*?)<\/span>';
preg_match('/'.$reg.'/i', $string, $match);
//this should get *whatever* is inside a span with class=link
$whatever=trim($match[4]);
//I will leave use of preg_match_all to you as an exercise but it's not much different :)