title: regexp to match an IP address in python
body: <p>I wrote the following regexp to match IP address,</p>
  
  <pre><code>x = 'IP is 200.185.24.24'
  y = re.findall('([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-2][0-3])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5])',x)
  </code></pre>
  
  <p>I am getting the following answer,</p>
  
  <pre><code>&gt;&gt;&gt; y
  [('200', '185', '24', '2')]
  </code></pre>
  
  <p>I have 2 questions here,</p>
  
  <ol>
  <li>Why my mast octet is failing here. Rest works fine.</li>
  <li>When you see my pattern above, I have repeated the same to match 2nd,3rd and 4th octet of an IP address. Is there a easy way to represent this repeated patterns. I guess \d in tcl is for repeat (not sure). I am looking for similar in python.</li>
  </ol>
  
  <p>Appreciate your inputs.</p>