Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将方法docu格式化为数组(regex/php)_Php_Regex - Fatal编程技术网

将方法docu格式化为数组(regex/php)

将方法docu格式化为数组(regex/php),php,regex,Php,Regex,我正试图使用REGEX格式化特定类的方法文档,以使其作为文档提供给其他人。docu看起来像这样: /** * Description description description * @access public * @GET string * [{ "name":"number","type":"string","description":"ASDASDASDAD" },{ "name":"number","type":"string","description":"ASDASDAS

我正试图使用REGEX格式化特定类的方法文档,以使其作为文档提供给其他人。docu看起来像这样:

/**
 * Description description description
 * @access public
 * @GET string
 * [{ "name":"number","type":"string","description":"ASDASDASDAD" },{ "name":"number","type":"string","description":"ASDASDASDAD" }]
 * @POST string
 * [{ "name":"number","type":"string","description":"ASDASDASDAD" }]
 * @RESPONSE type
 * [{ "name":"number","type":"string","description":"ASDASDASDAD" }]
 */
我想从该结构构建一个关联数组,如:

"description" => "Description description description"
"access" => "public"
"get" => array ( "type" => "string", "json" => "[{ "name":"number","type":"string","description":"ASDASDASDAD" }]"
等等。我目前的做法是把整个事情搞清楚,然后在"爆炸"上爆炸。这给了我所有不同的数组部分,但由于我对REGEX不是很有经验,所以我从那里过滤的所有努力都失败了


任何帮助都将不胜感激

寻找注释解析器已经足够了。例如,看看条令和/或symfony-不要使用正则表达式,使用。。。。但是在docblocks中为扩展的类使用
@see
@inherit(doc)
,您能为我指出正确的方向吗?我如何使用令牌实现这一点?我查看了php文档,但实际上没有任何有用的示例