Perl has Regexp::Optimizer, is there anything similar in PHP? My searches haven't turned up anything.
For example, Regexp::Optimizer would turn
/foobar|fooxar|foozap/
into
/foo(?:[bx]ar|zap)/
Update: I wanted to keep that question really short so that people would not try to over-interpret it but it turns out it had the opposite effect. I am looking for something that takes a regular expression and outputs a functionally equivalent yet more efficient regular expression. I have found such a thing in Perl but none in PHP, and I am wondering whether such a thing exists. In that respect, I expect a yes/no answer, accompagnied with a link if applicable. Thanks and sorry for the confusion.