I have the following
$data = "REFERENCE # 563005"
preg_match("/\d+/i", $data, $matches)
// $matches[0] will be set to 563005 with the above preg_match, however...
$data might be equal to "REFERENCE # 563005 & 563009 & 563125". In these cases, I need a regex to retrieve each instance of a number. So, doing a preg_match would set
$data = "REFERENCE # 563005 & 563009 & 563125"
preg_match("NEED REGEX", $data, $matches)
// $matches[0] would equal 563005,
// $matches[1] would equal 563009,
// $matches[2] would equal 563125,
Depending on how many numers are in the string. These numbers may be of any length and there may be up to 10-20 of these numbers in the data string.
[\d]+[\D]i think would work, but you might have to remove the last character of the returned strinf