$re = '/(?<=Set-Cookie: __RequestVerificationToken=).{108}/m';
$str = 'HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Set-Cookie: __RequestVerificationToken=6JBpdPLoWg2ON0CbCTTCffsZZsCU_rRGlmarVTRfg4Gu1_6FEqpgd_jcLbN_mBWdXJjCeYw6DQ3nxd8hABsNTpRWJALapk9KUZhu6jGkh0I1; path=/; HttpOnly
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
strict-transport-security: max-age=60; includeSubDomains
referrer-policy: strict-origin-when-cross-origin
Set-Cookie: httpOnly
X-Content-Security-Policy: script-src \'self\' https://fonts.gstatic.com
Date: Wed, 12 Feb 2020 15:46:34 GMT
Content-Length: 3124';
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