use strict;
my $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}';
my $regex = qr/(.*"state":"CA".*"active":true.*)/imp;
my $subst = '';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
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 Perl, please visit: http://perldoc.perl.org/perlre.html