regexp: 'a correctly parenthesized substring advanced'
| From: | Jaaboo | Date: | Mon, 29 Sep 2003 11:47:17 +0000 |
| Subject: | regexp: 'a correctly parenthesized substring advanced' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-164220@lists.php.net to get a copy of this message | ||
Hi ,
this is my regex for php to extract php-function-calls from source. It now
works for strings like:
func1($param,"abc")
func1($param1,func2($param2,"abc"))
but if i try to catch
func1($param1,"(c) by ARTADA for example")´, func2($param2,"786"))
it fails because of the paranthesis between the " " .
hás anyone an idea of how i can ignore paranthesis between the " " for
correct
counting the closing paranthesis
here is my current regex:
/([a-zA-Z]\w*?)\s*(\(((?>.*?)|.*?(?R)*)\))+/msi
this looks a little stupid but it catches all function calls within an
codeblock without the need of an function delimiter like ; in php
I need the functionality for a templating system where the syntax for the
templating system would be simpler and resitricted php code that i complete
to full working php code.
thax a lot for any suggestion