/e modifier is deprecated
<p>I run an open source project which is hosted on github. I'm currently about to release a new version which is running on PHP 7. This is where I'm needing help. I'm fairly strong with majority of PHP functions and equally comfortable with <code>mysqli</code> but in all my time running my project I've never worked with regex. I have two patterns with the now defunct <code>/e</code> modifier in use and have no idea how to fix them, so I'm hoping by asking the question here to actually learn something and also fix my problems.</p>

<p>Problem one is coming from one <code>preg_replace</code> I used for Geshi syntax highlighter for code tag.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>// [php]code[/php]
    if (stripos($s, '[php]') !== false) {
    $s = preg_replace("#\[(php|sql|html)\](.+?)\[\/\\1\]#ise", "source_highlighter('\\2','\\1')", $s);
}</code></pre>
</div>
</div>
</p>

<p>The second one handles media tags like liveleak etc:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>   if (stripos($s, '[media=') !== false) {
   $s = preg_replace("#\[media=(youtube|liveleak|GameTrailers|vimeo|imdb)\](.+?)\[/media\]#ies", "_MediaTag('\\2','\\1')", $s);
   }</code></pre>
</div>
</div>
</p>

<p>Both are not working and throwing this error:</p>

<blockquote>
  <p>PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead.</p>
</blockquote>

<p>Trouble is I have no idea how to work with regex, I've tried using tutorials over the past few weeks and still don't really understand it, any help would be really appreciated.</p>