A PHP regex to extract php functions from code files
- by user298593
I'm trying to make a PHP regex to extract functions from php source code. Until now i used a recursive regex to extract everything between {} but then it also matches stuff like if statements. When i use something like:
preg_match_all("/(function .(.))({([^{}]+|(?R))*})/",$this-data,$matches2);
It doesn't work when there is more than 1 function in…