$re = '/\#\#\#\#\#\#PROJECT\s+Name:\s+(?P<PROJECT_NAME>.+?)\#\#\#\#\#\#
.+?
(?P<OVERLOAD>OVERLOAD\(%\)(?:\s+\d+\.\d+){4}).+?
(?P<LOSS_OF_LOAD>LOSS\s+OF\s+LOAD\s+\(M\)(?:\s+\d+\.\d+){4})/sx';
$str = '######PROJECT Name: ABCD######
foo
bar
baz
OVERLOAD(%) 0.3361 10.0 3.4 2.49 1
LOSS OF LOAD (M) 10.5780 10.0 105.8 14026.67 11
######PROJECT Name: ABCD2######
foo
bar
baz
OVERLOAD(%) 0.3361 10.0 3.4 2.49 1
LOSS OF LOAD (M) 10.5780 10.0 105.8 14026.67 11';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php