title: I cannot make my javascript regexp to work
body: <p>I need to parse in javascript the value entered by the user in an html text field.</p>
  
  <p>That is my first regexp experience.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>var s = 'research library "not available" author:"Bernard Shaw"';
  var tableau = s.split(/(?:[^\s"]+|"[^"]*")/);
  for (var i=0; i&lt;tableau.length; i++) {
      document.write("tableau[" + i + "] = " + tableau[i] + "&lt;BR&gt;");
  }
  </code></pre>
  
  <p>I am expecting to see something like this:</p>
  
  <pre><code>tableau[0] = research
  tableau[1] = library
  tableau[2] = "not available"
  tableau[3] = author:
  tableau[4] = "Bernard Shaw"
  </code></pre>
  
  <p>But instead I got this:</p>
  
  <pre><code>tableau[0] =
  tableau[1] =
  tableau[2] =
  tableau[3] =
  tableau[4] =
  tableau[5] = 
  </code></pre>
  
  <p>Actually, what I really need is to split this value :</p>
  
  <pre><code>research library "not available" author:"Bernard Shaw"
  </code></pre>
  
  <p>into this array :</p>
  
  <pre><code>tableau[0] = research
  tableau[1] = library
  tableau[2] = "not available"
  tableau[3] = author:"Bernard Shaw"
  </code></pre>
  
  <p>But I think there is a problem with positive lookbehind in javascript or something like this.</p>
  
  <p>I did many tries without more success:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/650022/how-do-i-split-a-string-with-multiple-separators-in-javascript">How do I split a string with multiple separators in javascript?</a></li>
  <li><a href="https://stackoverflow.com/questions/4780728/regex-split-string-preserving-quotes">Regex split string preserving quotes</a></li>
  <li><a href="https://stackoverflow.com/questions/3569104/positive-look-behind-in-javascript-regular-expression">Positive look behind in JavaScript regular expression</a></li>
  <li><a href="https://stackoverflow.com/questions/16261635/javascript-split-string-by-space-but-ignore-space-in-quotes-notice-not-to-spli">javascript split string by space, but ignore space in quotes (notice not to split by the colon too)</a></li>
  </ul>
  
  <p>I think I really need some help...</p>