$re = '/([[:space:]]+|^)areaIntegrate\(down\) of grad\(T\)y[[:space:]]+/m';
$str = '
Time = 0
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
total faces = 4000
total area = 5.286456431623655e-06
areaIntegrate(down) of grad(T)y = -0.3799414476287353
Space-averaged Nusselt lambda = 5.34607670341618
Time = 0.45
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
areaIntegrate(down) of grad(T)y = -0.6680860499604798
Space-averaged Nusselt lambda = 5.34607670341618';
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