title: Javascript won't split using regex
body: <p>Since I started writing this question, I think I figured out the answers to every question I had, but I thought I'd post anyway, as it might be useful to others and more clarification might be helpful.</p>
  
  <p>I was trying to use a regular expression with lookahead with the javascript function split.  For some reason it was not splitting the string even though it finds a match when I call match.  I originally thought the problem was from using lookahead in my regular expression. Here is a simplified example:</p>
  
  <p>Doesn't work:</p>
  
  <pre><code>"aaaaBaaaa".split("(?=B).");
  </code></pre>
  
  <p>Works:</p>
  
  <pre><code>"aaaaBaaaa".match("(?=B).");
  </code></pre>
  
  <p>It appears the problem was that in the split example, the passed string wasn't being interpreted as a regular expression.  Using forward slashes instead of quotes seems to fix the problem.</p>
  
  <pre><code>"aaaaBaaaa".split(/(?=B)./);
  </code></pre>
  
  <p>I confirmed my theory with the following silly looking example:</p>
  
  <pre><code>"aaaaaaaa(?=B).aaaaaaa".split("(?=B).");
  </code></pre>
  
  <p>Does anyone else think it's strange that the match function assumes you have a regular expression while the split function does not?</p>