$re = '/Initiating task ContentDownload\s\w+\s\w+\s(?P<Deployment>ScopeId[^}]*)\}\s+\d*-\d*-\d*\s*\d*:\d*:\d*\.\d*\s\w*\s*(?P<Status>Unable.*)/m';
$str = 'Search :
ADSite_Membership="Initiating task ContentDownload for CI*" OR ADSite_Membership="Initiating Content Download*" OR ADSite_Membership="Unable to get locations*"
|table _time ADSite_Membership
Search Result:
2019-06-19 12:36:15.000 Initiating task ContentDownload for CI ScopeId_B4419992-1C14-4FC6-AB4E-D7730CD14853/DeploymentType_4a3a8593-e333-4bb4-a3f9-bb1ce19cf0eb.6 (GP4.1.11 BlueCoatDecom - User Interactive) for target: , consumer: {CA8EDD4A-6D29-4CE0-90AD-0EB22011B165}
2019-06-19 12:36:15.000 Initiating task ContentDownload for CI ScopeId_B4419992-1C14-4FC6-AB4E-D7730CD14853/DeploymentType_28ce7e7a-307a-417b-baf1-70c6bf0889d9.10 (Intel GFX driver 6th 7th 8th Apollo Gemini (EUDM - ALL)) for target: , consumer: {FE0C1DDA-725A-4FF2-9E20-D78968FAC529}
2019-06-20 12:58:02.414 Unable to get locations, no need to continue with download
2019-06-20 13:07:52.000 Initiating task ContentDownload for CI ScopeId_B4419992-1C14-4FC6-AB4E-D7730CD14853/DeploymentType_28ce7e7a-307a-417b-baf1-70c6bf0889d9.10 (Intel GFX driver 6th 7th 8th Apollo Gemini (EUDM - ALL)) for target: , consumer: {546E275F-FE56-4EA8-A37B-41508E57148D}';
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