$re = '/gsScrollPos=(.*?);|gsScrollPos=(.*)/';
$str = '_jsuid=1540521894; new=verified; __insp_slim=1441894084306; __insp_wid=1141935839; __insp_nv=true; __insp_ref=d; __insp_targlpu=http%3A%2F%2Flocalhost%2F; __insp_norec_sess=true; aff_tag=55b88a; aff_from=; aff_time=1441896839; gsScrollPos=; _gat=1; _ga=GA1.1.1421736560.1435009203';
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