symfony/symfony — pull request #4585 by Dinduks (2012-06-15 15:59:26+00:00)
Title: Add regexp support in HttpFoundation\Response::isRedirect()

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: Find a better place for the `isRegex()` method
License of the code: MIT
Documentation PR: Coming soon

---

We can now pass a regular expression to `isRedirect()` instead of a simple string. Example:

if ($response->isRedirect('/\/login$/'))

There's one more thing to do though: move the `isRegex()` method, which I did copy from the finder's [MultiplePcreFilterIterator](https://github.com/symfony/Finder/blob/master/Iterator/MultiplePcreFilterIterator.php#L47), to a better (more *global*?) place.
I think neither where I put it nor where it is right now are suitable places, because that method isn't related to the Finder or the HttpFoundation components only.

Where do you suggest to move it?