title: Javascript regular expression to ignore a sequence of full-stops/dots
body: <p>I'm trying to count the number of words in a string in javascript but ignore words that contain the characters "..." anywhere in the string.  I know that a "." can function as a special character in a regular expression but my attempts to break it below aren't working (4th line of the function)...</p>
  
  <pre><code>function countWords(s){
          s = s.replace(/(^\s*)|(\s*$)/gi,"");//exclude  start and end white-space
          s = s.replace(/[ ]{2,}/gi," ");//2 or more space to 1
          s = s.replace(/\n /,"\n"); // exclude newline with a start spacing
          s = s.replace(/\.\.\.$/,""); //exclude words ending in ...  
          return s.split(' ').length; 
      }
  </code></pre>
  
  <p>Does anyone know what I'm doing wrong?</p>