开发者

How can I extract all text between brackets in a PHP DocComment?

Let's say my DocComment looks like this:

/** 
 *  [Test] 
 *  [AnotherTest]
 */

What I want to end up with is an array that contains "Test" and "AnotherTest"

I know how to retrieve the DocComment using Reflection, I'm just not sure how I can parse those values out 开发者_JAVA百科cleanly. What is the best way to achieve this?


well the following regex should work:

/\[(.*?)\]/ 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜