You are here: Re: regex for PHP variable name « All PHP « IT news, forums, messages
Re: regex for PHP variable name

Posted by Sebosac on 05/19/07 09:35

Tom a écrit :
> "Sebosac" <sebosac@wanadoo.fr> wrote in message
> news:1179425971_309@qrz.fr...
>> hi, novice on regex, i'm searching for THE master Regex will retieve php
>> variable name like "$varname" in my script.
>>
>>
>> $tagparse = fil_gzet_contents('myscript.php');
>> preg_match_all("(.\$)", $tagparse, $out );
>>
>>
>> thank for your help
>
> What at you trying to find in "myscript.php", any variable names? Maybe
> something like this...
>
> preg_match_all("/\$\S+/", $tagparse, $out );
>
> Should do a pattern match for "$" and any not whitespace characters after
> the dollar sign.
>
> Tom

here what i'm trying to do :


"myscript.php" ccontaint someyhing like this :


$_Runtime_conf['config']['runtime']['_PRINCIPAL_CAT_SUBINDEXES_']=_CORE_MODULES_PRINCIPAL_MODULES_INDEXES($lien[1]
);

foreach($_Runtime_conf['config']['runtime']['_PRINCIPAL_CAT_SUBINDEXES_']
as $dref){
//echo( "<a href=\"?p=".$dref[7]." \" class=\"poggle_blue\" >
".$dref[8]."</a>&nbsp;&nbsp;" );
echo("<li><a href=\"?p=".$dref[1]."\">
".$dref[8]."<span></span></a></li>");
all_menu_site_map($dref);

}

and the reason of i need a regexp is to retrieve php Variable and
Function name to Eval() them.

i work on a Content System Manager, atemplate like system, after all my
try, a simple get_file_content, replace keywork and finish with eval()
on php code was unsuccessful and eval set me to "error in eval's code at
line 1", why, i can't explain this.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация