- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$re = '/\b(\d+)\.[A-Z]/';
$str = 'There are stores attached: Store1 (Detached) **28876.Mazon** (Detached) 28455.Targo (Detached) 28389.Walmo (Detached)';
preg_match_all($re, $str, $matches);
print_r($matches[1]);