Re: [PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
hi marek, thanx for your suggestion. i have tried out the tokenizer but 1. i think its not realy final and can change in the future 2. the tokenizer can only find real php code but i need to find my simplified php code without an ; on the end of an statement for example. so the tokenizer doesn't

Re: [PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Marek Kilimajer
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 $txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))"; if (preg_match_all(' / ([a-zA-Z]\w*?) \s* ( \( ( (?>.*?)| .*?(?R)*

[PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
I give an wrong example. Here is a better one .*?)| .*?(?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