regex help!
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | regex help! | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2121@lists.php.net to get a copy of this message | ||
I have been staring at this stupid script for an hour. in doc/funcparse
you will find a little script that goes through and picks functions out of
our source files. This is very useful for generating a complete list of
functions in PHP. Unfortunately a couple of modules, like xml.c, for
example, uses macros in the function_entry struct. I have been trying to
modify funcparse to recognize the PHP_FE() macro correctly. I have the
first part of it working for both cases. It looks like this:
/function_entry.*? # starts with this text + anything
{.*? # till first {
( # store this as $1
(?: # don't store the internal "loop" match
(PHP_FE|{).*?(}|\)).*? # non-greedy match { + anything + } + anything OR PHP_FE + anything + )
+ anything
)* # "loop" for all of them
) # store till here
} /six; # match closing }
which correctly yanks out the appropriate lines. Now, the second part
which picks the function names out of each line is giving me a headache.
If someone has some spare time, could you have a look at this script and
see if you can make it work for all the functions/*.c files?
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net