title: How to search a csv file for ip addresses using a regex?
body: <p>Think I am doing something stupid here, how can I search a file for ip addresses in python using regex?</p>
  
  <p>So far this is what I have:</p>
  
  <pre><code>def ip():
      ip = csv.reader(open('IP.csv'), delimited=',', quotechar='|')
      for x in ip:
         match = re.findall(r'(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})',x)
         if x == ipmatch:
            print(x)
  </code></pre>
  
  <p>Where am I going wrong to get <code>TypeError: expected string or bytes-like object</code> when I run this? Is it trying to use the match variable in the wrong place?</p>