- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$matches = array();
// $controller = $this->getRequest()->attributes->get('_controller');
$controller = "Acme\MyBundle\Controller\MyController::myAction";
preg_match_all('/(.*)\\Bundle\\(.*)\\Controller\\(.*)Controller::(.*)Action/', $controller, $matches);
print_r($matches);