Yes there is, sorry for not posting it.
The $html variable, as you may have guessed, contains the html of a whole page, fetched using file_get_contents.

It seems that if I put the real html in the $html variable, the thing breaks.

PHP Code:
$name "ttt_giant_daycare_V2.zip";
$url "http://freesteam.org/gmod/search.php?searchterm=" $name;
$html file_get_contents($url);

$regex '#[0-9]{1,9}(?=">' $name '</a>)#';
preg_match($regex$html$matches);
echo 
$matches[0]; 
That is the whole code, my fault for not posting it.
It can also be executed here, at my dev server:
http://fredrikblomqvist.developer.se/dev/getaddon.php