Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
('factories' => )(\[((?>[^\[\]]++|(?2))*)\])
/
gm
Input 1
New
<?php namespace Application; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; use Laminas\ServiceManager\Factory\InvokableFactory; return [ 'view_manager' => [ 'template_path_stack' => [ __DIR__ . '/../view', __DIR__ . '/../view/Application/_shared' ], ], 'controllers' => [ 'factories' => [ dsdsa ] ], 'service_manager' => [ 'factories' => [ 'UsersTableGateway' => function ($sm) { $dbAdapter = $sm->get('Laminas\Db\Adapter\Adapter'); $resultSetPrototype = new \Laminas\Db\ResultSet\ResultSet(); //get base url from config $config = $sm->get('Config'); $baseUrl = $config['view_manager']['base_url']; //pass base url via cnstructor to the User class $resultSetPrototype->setArrayObjectPrototype(new Model\Rowset
Substitution
<?php namespace Application; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; use Laminas\ServiceManager\Factory\InvokableFactory; return [ 'view_manager' => [ 'template_path_stack' => [ __DIR__ . '/../view', __DIR__ . '/../view/Application/_shared' ], ], 'controllers' => [ 'factories' => [ dsdsa ] ], 'service_manager' => [ 'factories' => [ 'UsersTableGateway' => function ($sm) { $dbAdapter = $sm->get('Laminas\Db\Adapter\Adapter'); $resultSetPrototype = new \Laminas\Db\ResultSet\ResultSet(); //get base url from config $config = $sm->get('Config'); $baseUrl = $config['view_manager']['base_url']; //pass base url via cnstructor to the User class $resultSetPrototype->setArrayObjectPrototype(new Model\Rowset