# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/(.*"state":"CA".*"active":true.*)//igm;t' <<< "{\"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}"
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 SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html