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

2003-09-30 Thread Jaaboo
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 do my job. i'm not far from the right solution it's
a litle step to bring the regex working with embeded parenthesis beetween 


i only had 2pregs in the complete source that can catch any type of
registered function call with the simplified syntax ... this is fast enough
for me ...

Marek Kilimajer [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 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
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-09-29 Thread Jaaboo
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP 5.0.0 Beta 1? better called alpha zero

2003-07-02 Thread Jaaboo
PHP5 Beta1?

yesterday i have downloaded the bin version of php5 for windows.
here are some problems that i have during my install / test.
some of them i have solved but a few i can't figure out.

1. if you have installed apache1.3x  and php4 before and want upgrade to
apache 1.3.x and php5 then you must replace the entry in the httpd.conf

from :

LoadModule php4_module c:/php/sapi/php4apache.dll

to

LoadModule php5_module c:/php/sapi/php4apache.dll

otherwise apache does not start. this is install.doc in the php distribution
tells you to use the first statement. it seems that the docs need some work
to reflect the new php5 config/install statements.

2. PHP5 comes without the clientlibs of mysql!!!

i find it very confusing that there is no more info about this on
www.php.net nor mysql.com
so what with lamp and wamp (will it be lans and wans for the new sqlite)

ok they don't budle mysql and php but how can we do it with php5 + mysql
where is the info , the how to ?

3. PHP5 have a completely new domxml extension . where is it ? the
recomended - php.ini in the distribution confuses you again with old module
entries that doesn't work.
what they meen with a complete new extension is it so new that we can't see
it? ;-)

4. i can't understand why they call it php5 beta1 , as long as mysql doesnt
work it can only called php5 alpha zero.

find infomation about php5 or the mysql probl. or domxml is like searching
for topsecret documents.

i find if they don't get mysql working the old way they will be so
incompatible that they can think again if they will introduce new syntax
like double underscore methods and other old stuff.
__constructor() why not constructor() ...





Sterling Hughes [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 The PHP development community is proud to announce the release of
 PHP 5 Beta 1.  Both source packages and a Win32 build are available, you
 can find these packages at http://www.php.net/downloads.php.  For a
 complete list of changes, please refer to
 http://www.php.net/ChangeLog-5.php.

 Some of the more major changes include:

   - PHP5 features the Zend Engine 2.  For a list of Zend Engine 2
 changes, please visit http://www.php.net/zend-engine-2.php.

   - XML support has been completely redone in PHP5, all extensions
 are now focused around the excellent libxml2 library
 (http://www.xmlsoft.org/).

   - SQLite has been bundled with PHP.  For more information on SQLite,
 please visit their website, http://www.hwaci.com/sw/sqlite/.

   - Streams have been greatly improved, including the ability to access
 low-level socket operations on streams.

   - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
 are no longer bundled with PHP.  For more information on these
 licensing changes please see the MySQL licensing policy [1]

 Note: This is a beta version. It should not be used in production or
 even semi-production web sites. There are known bugs in it, and in
 addition, some of the features may change (based on feedback). We
 encourage you to download and play with it (and report bugs[2] if you
 find any!), but please do not replace your production installations of
 PHP 4 at this time.

 [1] http://www.mysql.com/products/licensing.html
 [2] http://bugs.php.net/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php