symfony/symfony — pull request #2684 by andrewtch (2011-11-20 14:10:44+00:00)
Title: [HttpFoundation] Wildcard implementation for ParameterBag & Session

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

Implemented wildcard function for Session and ParameterBag; since there's no namespace support like in 1.4 in session this could be handy.

This is mostly regex matching for attribute/parameter keys and work like this:

```php
$session->set('user.name', 'John Doe');
$session->set('user.email', 'user@example.com');
$session->wildcard('user.*') //returns array('user.name' => 'John Doe', 'user.email' => 'user@example.com')
```

single character matching (user??.* for user12., user32. but not for user1.) also available.

Yes, I know about ParameterBag->get array support, but this is more generic solution - as proposed in pull request symfony/symfony#2541