I wanna catch Php classes from a file:
class a { function test() { } } class b extends a { function test() { } }
and the result matches must be
class a { function test() { } }
and
class b extends a { function test() { } }
Advertisement
Answer
regexps are poor at parsing programming languages’ grammars. Consider tokenizer functions instead. e.g. http://php.net/manual/en/function.token-get-all.php see also this http://framework.zend.com/apidoc/core/Zend_Reflection/Zend_Reflection_File.html