> -----Original Message-----
> From: Maxim Antonov [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 10, 2008 4:24 AM
> To: [email protected]; Daniel Brown
> Subject: Re: [PHP] 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