title: regex and javascript, some matches disappear !
body: <p>Here is the code :</p>
  
  <pre><code>&gt; var reg = new RegExp(" hel.lo ", 'g');
  &gt; 
  &gt; var str = " helalo helblo helclo heldlo ";
  &gt; 
  &gt; var mat = str.match(reg);
  &gt; 
  &gt; alert(mat);
  </code></pre>
  
  <p>It alerts "helalo, helclo", but i expect it to be "helalo, helblo, helclo, heldlo" . 
  Only the half of them matches, I guess that's because of the space wich count only once. So I tried to double every space before processing, but in some case it's not enough.
  I'm looking for an explanation, and a solution. </p>
  
  <p>Thx</p>