fork download
  1. <?php
  2.  
  3. $a = '[quote author=XXXX link=topic=137308.msg208143#msg208143 date=1389302491]foo bar bar foo[/quote]';
  4.  
  5. echo preg_replace("/\[quote\s+author=(\w+)[^\]]*]/g", "[quote=$1]", $a);
Success #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  preg_replace(): Unknown modifier 'g' in /home/fEBrT1/prog.php on line 5