title: Javascript: Regex to get values from string
body: <p>I suck at regexes so need some help with this, if I pass the below string into someFunction(str)</p>
  
  <pre><code>&lt;table width="100%" border="0" cellspacing="2" cellpadding="2" bgcolor="red"&gt; 
  </code></pre>
  
  <p>how can I get back an array like so:</p>
  
  <pre><code>arr[table] = "";
  arr[width] = "100%";
  arr[border] = "border";
  arr[cellspacing] = "cellspacing";
  arr[bgcolor] = "cellpadding";
  </code></pre>
  
  <p>or in other words, the first part of the array the tag name and the other parts its properties.</p>
  
  <p>Thanks!</p>