Regex analyser for PHP?
I would like to be able to inspect the structure of a PCRE regex. Is there a way to do this in PHP? Is there an internal function, or an extra extension, or even just a 3rd party class? Or will I have to write my own analyser, and if so, are there any caveats I should bear in mind?
Edit: Many people have pointed out that PHP's pcre exposes no functionality for this, and nobody has been able to suggest a PHP library that has been written for this task. I'm happy to consider hare-brained solutions involving piping the output of analysers from other languages into PH开发者_如何学CP, or something crazier.
There's no way you can do this in PHP. If you're looking for a regex analyzer, I find Regex Buddy (http://www.regexbuddy.com/) very useful. It's not free, but is relatively inexpensive. I'm not connected in any way - just a satisfied user.
精彩评论