($b) = $line =~ m#([^/]+)$#; ($c) = $line =~ m#(\d+)$#; if ($b eq $c){print "Match \n";}