Convert an Expression to Panfix Notation
JavaScript (ES6), 285 282 281 267 251 243 241 238 234 232 231 bytes
~15 bytes thanks to Neil.
f=(I,E=I.match(/\d+|./g),i=0)=&gt;(J=T=&gt;T.map?T.map(J).join``:T)((R=(H,l=(P=_=&gt;(t=E[i++])&lt;&quot;)&quot;?R(0):t)(),C,F)=&gt;{for(;(C=P())&gt;&quot;)&quot;&amp;&amp;(q=C&gt;&quot;*&quot;&amp;&amp;C&lt;&quot;/&quot;)*H-1;)F=q+H?l=[C,l,C,P(),C]:F?l[3]=[C,l[3],C,R(1),C]:l=R(1,l,i--)
i-=C&gt;&quot;)&quot;
return l})(0))

In JavaScript this is a bit harder than in Mathematica. This is basically an over-specialized and golfed operator-precedence parser.
Causes stack overflows on invalid inputs.
Demo


f=(I,E=I.match(/\d+|./g),i=0)=&gt;(J=T=&gt;T.map?T.map(J).join``:T)((R=(H,l=(P=_=&gt;(t=E[i++])&lt;")"?R(0):t)(),C,F)=&gt;{for(;(C=P())&gt;")"&amp;&amp;(q=C&gt;"*"&amp;&amp;C&lt;"/")*H-1;)F=q+H?l=[C,l,C,P(),C]:F?l[3]=[C,l[3],C,R(1),C]:l=R(1,l,i--)
i-=C&gt;")"
return l})(0))
&lt;input id="input" value="(5+3)*((9+18)/4-1)"/&gt;&lt;button onclick="console.log(f(document.querySelector('#input').value))"&gt;Convert&lt;/button&gt;



Ungolfed
convert = input =&gt; {
  tokens = input.match(/\d+|./g);
  i = 0;
  parse_token = () =&gt; (token = tokens[i++]) == &quot;(&quot; ? parse_tree(false) : token;
  parse_tree = (mul_div_mode, left = parse_token()) =&gt; {
    while ((oper = parse_token()) != &quot;)&quot; &amp;&amp; !((is_plus_minus = oper == &quot;+&quot; || oper == &quot;-&quot;) &amp;&amp; mul_div_mode)) {
      if (is_plus_minus || mul_div_mode)
        left = [oper, left, oper, parse_token(), oper];
      else if (non_first)
        left[3] = [oper, left[3], oper, parse_tree(true), oper];
      else
        left = parse_tree(true, left, i--);
      non_first = true;
    }
    if (oper != &quot;)&quot;)
      i--;
    return left;
  };
  format_tree = tree =&gt; tree.map ? tree.map(format_tree).join(&quot;&quot;) : tree;
  return format_tree(parse_tree(false));
}