[ create a new paste ] login | about

Link: http://codepad.org/eI4FBzZO    [ raw code | output | fork ]

PHP, pasted on Nov 24:
1
2
3
4
5
<?php
 $str = '[traduci id=\'HELLO\']ciao[/traduci][traduci  id=\'HELLO\'   not=\'fr\' ]ciao[/traduci][traduci not="fr" id="HELLO"]ciao[/traduci][traduci   not="fr"   id="HELLO" param="abc"]ciao[/traduci]';

// traduco in francese
echo preg_replace("#\[traduci\s+id='HELLO'((.*?)!?\])(.*?)\[\/traduci\]#","SALUT",$str);?>


Output:
1
SALUTSALUT[traduci not="fr" id="HELLO"]ciao[/traduci][traduci   not="fr"   id="HELLO" param="abc"]ciao[/traduci]


Create a new paste based on this one


Comments: