title: Quick Regex Perl not terminated
body: <p>I'm trying to convert Wiki markup to HTML markup, i.e. </p>
  
  <pre class="lang-none prettyprint-override"><code>[[Image:wiki.png]]
  [[Image:wiki.png|Wikipedia, The Free Encyclopedia.]]
  </code></pre>
  
  <p>to</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;img src="wiki.png" alt=""/&gt;
  &lt;img src="wiki.png" alt="Wikipedia, The Free Encyclopedia."/&gt;
  </code></pre>
  
  <p>using a line of Perl</p>
  
  <pre class="lang-perl prettyprint-override"><code>s/\[\[Image:(\w+?\.png)\|{0,1}(.*?)\]\]/g;
  print;
  </code></pre>
  
  <p>But Perl keeps throwing the error</p>
  
  <blockquote>
    <p>Substitution replacement not terminated</p>
  </blockquote>
  
  <p>It works in <a href="http://regexr.com/33sk4" rel="nofollow">this RegExr test</a> and changing the delimiter has not fixed the issue. Any insight would be much appreciated.</p>