title: Checking Duplicate & valid Numbers in Textarea using jQuery
body: <p>I'm developing a jQuery validation on a textarea which contains 
  10 digit mobile numbers line by line</p>
  
  <p>i used this code to make sure after every 10 digit new line occur.</p>
  
  <pre><code> $('#mobile_numbers').keyup(function () {
  
          if (/\D/g.test(this.value))
          {
              this.value = this.value.replace(/\D/g, '');
          }
  
          this.value = this.value
              .replace(/[\n\r]+/g, "")
              .replace(/(.{10})/g, "$1\n");
      });
  </code></pre>
  
  <p>The above code also force to enter only numric value and after every 10th digit it adds new line.</p>
  
  <p>Everything is working fine but i'm stuck in the situation that</p>
  
  <p>1) I'm trying to check the mobile numbers are valid or not
  the condition for that is it should start from 7 or 8 or 9 and it contain 10 digit per line and if not i will remove it.</p>
  
  <p>2) Also i'm trying to count duplicate number &amp; valid number across the data in textarea using jquery and showing the output in HTML as</p>
  
  <pre><code>Eg: (User type in text area)
  7777777777
  8888888888
  9999999999
  7777777776
  6601145591 // Invalid (should start with 7/8/9 &amp; 10 digit)
  5566887744 //Invalid
  664433     //Invalid
  8888888886
  9999999996
  9999999996
  8888888886
  
  Output:
  &lt;h1&gt;Total number: 11&lt;h1&gt;
  &lt;h1&gt;Duplicate number: 2&lt;h1&gt;
  &lt;h1&gt;Valid number: 6&lt;h1&gt;
  </code></pre>
  
  <p>I don't know the thing i'm trying is possible or not.
  If possible how to do this,
  I will do it myself if i can get the documentation link.
  But i'm afraid to code this as i'm a back end developer i'm checking everything in PHP but i want to make sure the validation at client side also using jQuery.</p>
  
  <p>Thanks in advance.</p>