#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?|(\[[\"]?.+?[\"]?\])(=>)\R\s*|(?<=\(0\) )(\{)\R\s*(\}))"
Local $sString = "object(Symfony\Component\HttpFoundation\Request)#250 (21) {" & @CRLF & _
" ["attributes"]=>" & @CRLF & _
" object(Symfony\Component\HttpFoundation\ParameterBag)#253 (1) {" & @CRLF & _
" ["parameters":protected]=>" & @CRLF & _
" array(5) {" & @CRLF & _
" ["_controller"]=>" & @CRLF & _
" object(Closure)#239 (2) {" & @CRLF & _
" ["static"]=>" & @CRLF & _
" array(1) {" & @CRLF & _
" ["app"]=>" & @CRLF & _
" object(Silex\Application)#14 (8) {" & @CRLF & _
" ["providers":protected]=>" & @CRLF & _
" array(5) {" & @CRLF & _
" [0]=>" & @CRLF & _
" object(Silex\Provider\HttpKernelServiceProvider)#17 (0) {" & @CRLF & _
" }" & @CRLF & _
" [1]=>" & @CRLF & _
" object(Silex\Provider\RoutingServiceProvider)#26 (0) {" & @CRLF & _
" }" & @CRLF & _
" [2]=>" & @CRLF & _
" object(Silex\Provider\ExceptionHandlerServiceProvider)#36 (0) {" & @CRLF & _
" }" & @CRLF & _
" [3]=>" & @CRLF & _
" object(Silex\Provider\TwigServiceProvider)#38 (0) {" & @CRLF & _
" }" & @CRLF & _
" [4]=>" & @CRLF & _
" object(Euskadi31\Silex\Provider\CorsServiceProvider)#54 (0) {" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
" ["booted":protected]=>" & @CRLF & _
" bool(true)" & @CRLF & _
" ["values":"Pimple\Container":private]=>" & @CRLF & _
" array(37) {" & @CRLF & _
" ["request.http_port"]=>" & @CRLF & _
" int(80)" & @CRLF & _
" ["request.https_port"]=>" & @CRLF & _
" int(443)" & @CRLF & _
" ["debug"]=>" & @CRLF & _
" bool(true)" & @CRLF & _
" ["charset"]=>" & @CRLF & _
" string(5) "UTF-8"" & @CRLF & _
" ["logger"]=>" & @CRLF & _
" NULL" & @CRLF & _
" ["resolver"]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\Controller\ControllerResolver)#307 (1) {" & @CRLF & _
" ["logger":"Symfony\Component\HttpKernel\Controller\ControllerResolver":private]=>" & @CRLF & _
" NULL" & @CRLF & _
" }" & @CRLF & _
" ["argument_metadata_factory"]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory)#301 (0) {" & @CRLF & _
" }" & @CRLF & _
" ["argument_value_resolvers"]=>" & @CRLF & _
" array(5) {" & @CRLF & _
" [0]=>" & @CRLF & _
" object(Silex\AppArgumentValueResolver)#298 (1) {" & @CRLF & _
" ["app":"Silex\AppArgumentValueResolver":private]=>" & @CRLF & _
" *RECURSION*" & @CRLF & _
" }" & @CRLF & _
" [1]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestAttributeValueResolver)#295 (0) {" & @CRLF & _
" }" & @CRLF & _
" [2]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestValueResolver)#292 (0) {" & @CRLF & _
" }" & @CRLF & _
" [3]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver)#289 (0) {" & @CRLF & _
" }" & @CRLF & _
" [4]=>" & @CRLF & _
" object(Symfony\Component\HttpKernel\Controller\ArgumentResolver\VariadicValueResolver)#286 (0) {" & @CRLF & _
" }" & @CRLF & _
" }"
Local $sSubst = "\1 \2"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm