title: Javascript split at multiple delimters while keeping delimiters
body: <p>Is there a better way than what I have (through regex, for instance) to turn </p>
  
  <pre><code>"div#container.blue"
  </code></pre>
  
  <p>into this</p>
  
  <pre><code>["div", "#container", ".blue"];
  </code></pre>
  
  <p>Here's what I've have... </p>
  
  <pre><code>var arr = [];
  function process(h1, h2) {
      var first = h1.split("#");
      arr.push(first[0]);
      var secondarr = first[1].split(".");
      secondarr[0] = "#" + secondarr[0];
      arr.push(secondarr[0]);
      for (i = 1; i&lt; secondarr.length; i++) {
          arr.push(secondarr[i] = "." + secondarr[i]);
      }
      return arr;
  }
  </code></pre>