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:
/\[(.*?)\]/
精彩评论