title: If/else clause on loop statement with re.search does not work (python)
body: <p>I want to parse lines of a file and get IP adresses.<br>
  I use re.search  and I want to print both :<br>
  - the IP's<br>
  - the string 'None' when there's not an IP  </p>
  
  <p>Considering the file corresponds to the variable logfile, I wrote this snippet :  </p>
  
  <pre><code>import re, sys
  
  regexip = r'(?!91.134.143.128)[0-9]{2,3}[.][0-9]{2,3}[.][0-9]{2,3}[.][0-9]{2,3}'
  logfile = '91.12.13.14, 65.12.45.78, aaa'
  
  my_iplist = re.findall(regexip,logfile)
  for ii in my_iplist:
      if re.search (regexip,logfile):
          print ii
      else:
          print 'None'
  </code></pre>
  
  <p>The problem is that I only get these results...  </p>
  
  <blockquote>
    <p>91.12.13.14<br>
    65.12.45.78</p>
  </blockquote>
  
  <p>... whereas I want to have :  </p>
  
  <blockquote>
    <p>91.12.13.14<br>
    65.12.45.78<br>
    None  </p>
  </blockquote>
  
  <p>That else statement does not work. I suppose there's something I do wrong but I don't know what it is..<br>
  Any help would be very appreciated.<br>
  Thanks !</p>