Re: Re: regexp: 'a correctly parenthesized substring advanced'

From: Date: Tue, 30 Sep 2003 11:41:49 +0000
Subject: Re: Re: regexp: 'a correctly parenthesized substring advanced'
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-164381@lists.php.net to get a copy of this message
Forget regexp and try this function: http://sk.php.net/manual/en/function.token-get-all.php Jaaboo wrote:
I give an wrong example. Here is a better one <?php $txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))"; if (preg_match_all(' / ([a-zA-Z]\w*?) \s* ( \( ( (?>.*?)| .*?(?R)* ) \) )+ /x ', $txt, $m)){ print_r($m); } else { echo "no match"; } echo "\n"; ?> This must result in : First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody")) Second call with the inner part $par1," 100 (euro)", func2($par2,"(c) by nobody") must result in : func2($par2,"(c) by nobody") Please visit www.regexp.org there is an open thread of this question. thanx


« previous php.general (#164381) next »