我想从文件中捕获Php类:
class a {
function test() { }
}
class b extends a {
function test() { }
}
Run Code Online (Sandbox Code Playgroud)
结果匹配必须是
class a {
function test() { }
}
Run Code Online (Sandbox Code Playgroud)
和
class b extends a {
function test() { }
}
Run Code Online (Sandbox Code Playgroud)
regexp在解析编程语言的语法方面很差.请考虑使用tokenizer函数.例如http://php.net/manual/en/function.token-get-all.php 也参见http://framework.zend.com/apidoc/core/Zend_Reflection/Zend_Reflection_File.html
| 归档时间: |
|
| 查看次数: |
687 次 |
| 最近记录: |