$re = '/(.*"state":"CA".*"active":true.*)/im';
$str = '{"id":1,"last":"Doe","first":"John","location":{"city":"San Francisco","state":"CA","postalCode":"94105"},"active":true}
{"id":2,"last":"Dosdsf","first":"Jane","location":{"city":"San Jose","state":"CA","postalCode":"94110"},"active":false}
{"id":3,"last":"Dodsde","first":"Johnathan","location":{"city":"Los Angeles","state":"WA","postalCode":"90045"},"active":true}
{"id":4,"last":"Dhruvil","first":"Darji","location":{"city":"San Francisco","state":"CA","postalCode":"90304"},"active":false}
{"id":5,"last":"Meghal","first":"Gandhi","location":{"city":"Irvine","state":"WA","postalCode":"94155"},"active":true}';
$subst = "";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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