# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/(?|(\[[\"]?.+?[\"]?\])(=>)\R\s*|(?<=\(0\) )(\{)\R\s*(\}))/\1 \2/g;t' <<< "object(Symfony\Component\HttpFoundation\Request)#250 (21) {
[\"attributes\"]=>
object(Symfony\Component\HttpFoundation\ParameterBag)#253 (1) {
[\"parameters\":protected]=>
array(5) {
[\"_controller\"]=>
object(Closure)#239 (2) {
[\"static\"]=>
array(1) {
[\"app\"]=>
object(Silex\Application)#14 (8) {
[\"providers\":protected]=>
array(5) {
[0]=>
object(Silex\Provider\HttpKernelServiceProvider)#17 (0) {
}
[1]=>
object(Silex\Provider\RoutingServiceProvider)#26 (0) {
}
[2]=>
object(Silex\Provider\ExceptionHandlerServiceProvider)#36 (0) {
}
[3]=>
object(Silex\Provider\TwigServiceProvider)#38 (0) {
}
[4]=>
object(Euskadi31\Silex\Provider\CorsServiceProvider)#54 (0) {
}
}
[\"booted\":protected]=>
bool(true)
[\"values\":\"Pimple\Container\":private]=>
array(37) {
[\"request.http_port\"]=>
int(80)
[\"request.https_port\"]=>
int(443)
[\"debug\"]=>
bool(true)
[\"charset\"]=>
string(5) \"UTF-8\"
[\"logger\"]=>
NULL
[\"resolver\"]=>
object(Symfony\Component\HttpKernel\Controller\ControllerResolver)#307 (1) {
[\"logger\":\"Symfony\Component\HttpKernel\Controller\ControllerResolver\":private]=>
NULL
}
[\"argument_metadata_factory\"]=>
object(Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory)#301 (0) {
}
[\"argument_value_resolvers\"]=>
array(5) {
[0]=>
object(Silex\AppArgumentValueResolver)#298 (1) {
[\"app\":\"Silex\AppArgumentValueResolver\":private]=>
*RECURSION*
}
[1]=>
object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestAttributeValueResolver)#295 (0) {
}
[2]=>
object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestValueResolver)#292 (0) {
}
[3]=>
object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver)#289 (0) {
}
[4]=>
object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\VariadicValueResolver)#286 (0) {
}
}"
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