PHP Regex / delimiter
<p>I have a string <code>"/test:n(0-2)/div/"</code> which I want to split via Regex into an array with function <code>preg_split()</code>. The output should be like this:</p>

<pre><code>output = {
[0]=&gt;"test:n(0-2)"
[1]=&gt;"div"
}
</code></pre>

<p>However it seems not to be that easy as I have thought it is. Here are my attempts: <a href="https://regex101.com/r/iP2lD8/1" rel="nofollow noreferrer">https://regex101.com/r/iP2lD8/1</a></p>

<pre><code>$re = '/\/.*\//';
$str = '/test:n(0-2)/div/';
$subst = '';

$result = preg_replace($re, $subst, $str, 1);

echo "The result of the substitution is ".$result;
</code></pre>

<blockquote>
  <p>Full match 0-17:<br>
  /test:n(0-2)/div/</p>
</blockquote>

<p>What am I doing wrong?</p>