title: Validate if input string is a number between 0-255 using regex
body: <p>I am facing problem while matching input string with Regex. I want to validate input number is between 0-255 and length should be up to 3 characters long. code is working fine but when I input 000000 up to any length is shows true instead false.</p>
  
  <p>Here is my code :-</p>
  
  <pre><code>String IP = "000000000000000";
          System.out.println(IP.matches("(0*(?:[0-9][0-9]?|[0-2][0-5][0-5]))"));
  </code></pre>