Need help with regular expression

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

 



Hi, all!

I try to use folowing regular expression:
$out = preg_replace('#\{%%%.*?\{%bigfoto%\}.*?%%%\}#is','==REPLACEMENT==',$str);

It not work as I need. Please tell me - what I do wrong?

I have string:


<tr><td>NAME:</td><td><input type="text" name="name" value="" size="80"/></td></tr>
 <tr><td>Foto:</td><td><input type="file" name="foto" value="{%foto%}" />
  {%%%<br/><img alt="{%name%}" src="{%foto%}"/>%%%}
  </td></tr>
 <tr><td>Big foto:</td><td><input type="file" name="bigfoto" value="" />
  {%%%<br/><img alt="{%name%}" src="{%bigfoto%}"/>%%%}
  </td></tr>



I need result as:


<tr><td>NAME:</td><td><input type="text" name="name" value="" size="80"/></td></tr>
 <tr><td>Foto:</td><td><input type="file" name="foto" value="{%foto%}" />
  {%%%<br/><img alt="{%name%}" src="{%foto%}"/>%%%}
  </td></tr>
==REPLACEMENT==


And I have this result:

<tr><td>NAME:</td><td><input type="text" name="name" value="" size="80"/></td></tr>
 <tr><td>Foto:</td><td><input type="file" name="foto" value="{%foto%}" />
==REPLACEMENT==
  </td></tr>


--
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