fork(1) download
  1. <?php
  2.  
  3. $re = '/\[\[([^][|]*?)\|([^][]*?)]]/';
  4. $str = 'foo [[http://www.google.com|This Link points to google]] foo [[http://w...content-available-to-author-only...e.com|This Link points to more]]';
  5. echo preg_replace($re, '<a href="$1">$2</a>', $str);
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
foo <a href="http://www.google.com">This Link points to google</a> foo <a href="http://w...content-available-to-author-only...e.com">This Link points to more</a>