title: Convert Java tokenizing regex into Javascript
body: <p>As an answer to my question <a href="https://stackoverflow.com/questions/21408570/tokenizing-an-infix-string-in-java">Tokenizing an infix string in Java</a>, I got the regex <code>(?&lt;=[^\.a-zA-Z\d])|(?=[^\.a-zA-Z\d]</code>. However, now I'm writing the same code in Javascript, and I'm stuck as to how I would get a Javascript regex to do the same thing.</p>
  
  <p>For example, if I have the string <code>sin(4+3)*2</code>, I would need it parsed into <code>["sin","(","4","+","3",")","*","2"]</code></p>
  
  <p>What regex would I use to tokenize the string into each individual part. </p>
  
  <p>Before, what I did is I just did a string replace of every possible token, and put a space around it, then split on that whitespace. However, that code quickly became very bloated.</p>
  
  <p>The operators I would need to split on would be the standard math operators (<code>+,-,*,/,^)</code>, as well as function names <code>(sin,cos,tan,abs,etc...)</code>, and commas</p>
  
  <p>What is a fast, efficient way to do this?</p>