I am trying to match an "ID" in a string, composed by some numbers (ranging from 1 digit to ~9 (the point is that it has got a variable length). The following code won't backreference my ID, I'm very new to PHP and I've tried google with no good answer.
<?php
$to = 'data-hovercard="/ajax/hovercard/user.php?id=100002781344760">Ae fj';
preg_match('/user.php?id=[\d]+\\"/', $to, $matches);
echo $matches[0];
?>
The whole point is to get the "10000278134476" in "/ajax/hovercard/user.php?id=100002781344760">". Any useful regexes?