^(\S+)\s+|\s+(?=\S+$)
Try to share this. Sample code.
preg_split('/^(\S+)\s+|\s+(?=\S+$)/', 'ABC DEF SASF 123 (35)', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)
Or just a coincidence and capture of captures instead of separation.
^(\S+)\s+(.*?)\s+(\S+)$
Watch the demo
$re = "/^(\\S+)\\s+(.*?)\\s+(\\S+)$/"; $str = "ABC DEF SASF 123 (35)"; preg_match_all($re, $str, $matches);
source share