This post originated from an RSS feed registered with PHP Buzz
by Tobias Schlitt.
Original Post: Regex guru needed
Feed Title: Tobias Schlitt - Weblog
Feed URL: http://php-applications.de/lists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundapplications/blog/rss.php?category=2_PHP&version=0.91
Feed Description: a passion for php
I recently wanted to extract all function/method prototypes from a PHP files, using PCRE. The extraction itself is not a real problem, but for further processing I need every single parameter of each function as a seperate element. Surely it would be no problem, when using 2 regex (a. extract the function prototype, b. extract the parameters), but this would (IMHO) be much more resource intensive than doing all at once.
Here is a (much smaller than the real one) example which describes the problem (see the extended entry for the real regex I developed):