title: How to count non-empty lines inside a string in javascript
body: <p>i'm using this function to count empty lines inside a string.</p>
  
  <pre><code>function count_empty_lines(text){
      return text ? (text.match(/^[ \t]*$/gm) || []).length : 0;
  }
  </code></pre>
  
  <p>I'm trying to edit that regex in order to implement a function that counts <strong>non</strong> empty lines.</p>
  
  <pre><code>function count_non_empty_lines(text){
  }
  </code></pre>
  
  <p>Any ideas? Thanks!</p>