# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/\$([\w]+)->([^\W]+)/$\1['\2']/g;t' <<< " @foreach($fsn_uploaded_data as $client_no => $client)
<div class=\"client\" style=\"border: 1px solid #888; margin-bottom: 10px;\">
<h2>{{ $client['client_name'] or '-' }}</h2>
<p>{{ $client->postal_address or '-' }}, {{ $client->zip_code_postcode or '-' }}, {{ $client->city or '-' }}, {{ $client->countr_code or '-' }}</p>
}
{{-- @foreach($client->delivery_addresses as $delivery_no => $address)
<div class=\"delivery_addresses\" style=\"border: 1px solid #ddd; margin: 5px;\">
<h3>{{ $address->client_delivery_name or '-' }}</h3>
<p>{{ $address->delivery_address or '-' }}, {{ $address->zip_code or '-' }}</p>
</div>
@endforeach --}}
</div>
@endforeach"
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