I would like to ask if it's possible to delete all strings between two strings even on different line ?
Here is the original file:
<?php
$CONFIG = array (
'trusted_domains' =>
array (
0 => '192.168.0.32',
),
'datadirectory' => '/var/www/html/files/data',
'overwrite.cli.url' => 'http://192.168.0.44/files',
'dbtype' => 'mysql',
'dbport' => '',
'installed' => true,
'loglevel' => 2,
'maintenance' => false,
);
What I expect :
<?php
$CONFIG = array (
'trusted_domains' =>
array (
),
'datadirectory' => '/var/www/html/files/data',
'overwrite.cli.url' => 'http://192.168.0.44/files',
'dbtype' => 'mysql',
'dbport' => '',
'installed' => true,
'loglevel' => 2,
'maintenance' => false,
);
I want to empty everything inside trusted domains.
What I tried :
sed -e 's/\(trusted_domains\).*\(\),\)/\1\2/'