preg_replace() is returning an empty string for the following line of code. The aim is to replace anything that's not a number with a hyphen. Through an online tester I believe the regex catches the right things, but for some reason this line is always returning an empty string.
preg_last_error() returns no error. Any suggestions?
$subRef = preg_replace("/[^(\d)]/g", "-", $subRef);