<?php $re = '/(?P<first>[^#]*)#(?P<second>\d{0,7}\.\d{1,2}|\w+)/'; $str = 'Test 1#1.00 Test 2#2.00 Test 3#3.00 Test 1#1.00 Test 2#FOC Test 3#3.00'; echo "\n";
Standard input is empty
Array
(
[0] => Test 1
[1] => Test 2
[2] => Test 3
[3] =>
Test 1
[4] => Test 2
[5] => Test 3
)
Array
(
[0] => 1.00
[1] => 2.00
[2] => 3.00
[3] => 1.00
[4] => FOC
[5] => 3.00
)