开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜