you can also use the character class digit:
$find = "(<a href\=\"test)[[:digit:]]+(\">)";
$replace = "\1YOUR_NEW_VALUE\2";
$new_string = eregi_replace($find, $replace, $YOUR_TEXT);
The statment finds any occurence that has
1) <a href="test
2) Then it looks after test for any digit(s) there is to be one or more number (if you want 0 or more use the '*' instead of the '+')
3) Looks after the digit(s) for ">
4) replaces the digit(s) with what ever you specify in the variable replace between \1 and \2
As Always
Clive