RE: Need help with regular expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Maxim Antonov [mailto:max@xxxxxxxxxxxxxxx]
> Sent: Thursday, July 10, 2008 4:24 AM
> To: php-general@xxxxxxxxxxxxx; Daniel Brown
> Subject: Re:  Need help with regular expression
> 
> Hello.
> 
> But I need no td and tr inside regular expression
> It is a part of my templater.
> 
> 
> In real code it looks like:
>    if(strlen($item[$key])<1){
>                  return
> preg_replace('#\{%%%.*?\{%'.$key.'%\}.*?%%%\}#is','',$tpl);
>              }
> 
> if one of $key inside  {%%% .... %%%} points to empty array item - all
> section between {%%% %%%} must be deleted.

---8<--- snip

Maxim,

You could try using a "capture group," and re-assemble the match with
the match group inbetween your {%%% %%%} omitted. Just an idea.


Todd Boyd
Web Programmer




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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux