private function getParameterBag($subject)
    {
        // Backwards compability - replace twig tags with parameters
        $pattern_bc = '/\{\{\s(?<param>[a-zA-Z0-9.]+)\s\}\}+/';

        if (preg_match_all($pattern_bc, $subject, $match_params)) {
            $string = preg_filter($pattern_bc, '%\1%', $subject);

            $param = array();
            foreach ($match_params['param'] as $value) {
                $param[$value] = $value;
            }

            return array(
                'string' => $string,
                'params' => $param
            );
        }

        # Feature - read key/value syntax parameters
        $pattern_string = '/^(?<string>[^|]+)(?<parameter_bag>\|\{(\s?%[a-zA-Z0-9.]+%:\s[a-zA-Z0-9.]+,?\s?)+\s?\}\|)\s*$/';
        $pattern_params = '/(?>(?<=(\|\{\s|.,\s))%(?<key>[a-zA-Z0-9.]+)%:\s(?<value>[a-zA-Z0-9.]+)(?=(,\s.|\s\}\|)))+/';

        if (preg_match($pattern_string, $subject, $match_string)) {
            $string = $match_string['string'];
            $parameter_bag = $match_string['parameter_bag'];

            $param = array();
            preg_match_all($pattern_params, $parameter_bag, $match_params, PREG_SET_ORDER);

            foreach ($match_params as $match) {
                $param[$match['key']] = $match['value'];
            }

            return array(
                'string' => $string,
                'params' => $param
            );
        }

        # Feature - read abbreviated syntax parameters
        $abbreviated_pattern_string = '/^(?<string>[^|]+)(?<parameter_bag>\|\{(\s?[a-zA-Z0-9.]+,?\s?)+\s?\}\|)\s*$/';
        $abbreviated_pattern_params = '/(?>(?<=(\|\{\s|.,\s))(?<param>[a-zA-Z0-9.]+)(?=(,\s.|\s\}\|)))+?/';

        if (preg_match($abbreviated_pattern_string, $subject, $match_string)) {
            $string = $match_string['string'];
            $parameter_bag = $match_string['parameter_bag'];

            $param = array();
            preg_match_all($abbreviated_pattern_params, $parameter_bag, $match_params);

            foreach ($match_params['param'] as $value) {
                $param[$value] = $value;
            }

            return array(
                'string' => $string,
                'params' => $param
            );
        }

        // If subject does not match any pattern, return false
        return false;
    }