How can I match the
'api-tools-mvc-auth' => ['authentication' => ['adapters' => ['comics' => ['adapter' => 'Laminas\\ApiTools', ], ], ], ],
from the contents of:
return ['db' => ['username' => 'root','password' => '', ],'api-tools-mvc-auth' => ['authentication' => ['adapters' => ['comics' => ['adapter' => 'Laminas\\ApiTools', ], ], ], ],
So the match need to contain any nested []
as well as new line characters. BUT it can only match the section with particular prefix, for instance: 'api-tools-mvc-auth' => [
I am using regex in PHP.
So far I only have a regex which work just for single lines: https://regex101.com/r/GXtk6v/2