title: How to write a regular expression for IP address format
body: <p>Please help me out
  I want to use the regular expression for IP address in that expression it should take only number not Alphabet text </p>
  
  <p>suppose my IP Address is like that 111.111.1.111</p>
  
  <p>When the user enter the IP address then starting it should take 3 number then dot like that goes on </p>
  
  <p>i used these expression which help to stop writing Alphabet</p>
  
  <pre><code>if ("" != this.value.replace(/((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$/g, '')) {
            this.value = this.value.replace(/[^0-9\.]/g, '');
            } 
  </code></pre>