my $chain = '/td>Moving Services for MSCD Student Success Building'; if($chain =~ /(.*?)<\/td>/m){print $1} else {print "ups"};