$re = '/(?s)\/system.\/sensor\d\d.+DeviceID=(?P<sensor>[^\n]*).*CurrentReading=(?P<reading>[^\n]*).*SensorType=(?P<type>[^\n]*).*HealthState=(?P<health>[^\n]*).*/';
$str = '/system1/sensor37
Targets
Properties
DeviceID=37-Fuse
ElementName=Power Supply
OperationalStatus=Ok
RateUnits=Celsius
CurrentReading=49
SensorType=Temperature
HealthState=Ok
oemhp_CautionValue=100
oemhp_CriticalValue=Not Applicable
';
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