title: IP address formatting in list while removing duplicates (not a duplicate)
body: <h1>this is not a duplicate question.  I already researched the provided links and the suggestions did not help.  I did open a new question that hopefully provided some clarification.</h1>
  <p>Let me clarify my questions:
  My ultimate goal is to remove the duplicate IP addresses from the list.  I primarily need help with the following issue: I keep running into issues with maintaining the integrity of the IP addresses whenever I try to apply code (itertools, 'for' loops, etc) that removes duplicates from the output.</p>
  <p><strong>In summary:</strong></p>
  <p>1.My output is a tuple containing the matching strings (ip addresses)</p>
  <p>2.I convert the tuple to a list of lists - print(hop_list)</p>
  <p>3.I index [0] on the list of lists to obtain the IP addresses I need - print(ips)
  <strong>Is this where the problem lies?  the output doesn't look like a list of list?</strong></p>
  <p>4.I apply various code solutions to remove duplicate addresses but for some reason I lose the integrity of my IP addresses.</p>
  <p>per exscript api docs:
  •  anymatch: If a match is found and the regular expression has multiple groups, a tuple containing the matching strings from the groups is returned.</p>
  <pre><code>def ios_commands(job, host, conn):        #function to execute IOS commands
  conn.execute('terminal length 0')
  conn.execute('tr {}'.format(DesAddr))
  print('The results of the traceroute', repr(conn.response))
  for hops in any_match(conn, r&quot;((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([ (\[]?(\.|dot)[ )\]]?(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3})&quot;):
      hop_list = list(hops)  #create a list from tuple
      ips = hop_list[0]   #index on targeted addresses
      print(list(uniqify(ips)))  #filter out duplicates
  </code></pre>
  <p><strong><code>print(hop_list)       #so far so good, list of lists from tuple</code></strong></p>
  <p>['192.33.12.4', '192', '.4', '.', '4']</p>
  <p>['192.33.12.4', '192', '.4', '.', '4']</p>
  <p>['192.32.0.174', '192', '.174', '.', '174']</p>
  <p>['192.32.0.190', '192', '.190', '.', '190']</p>
  <p>['192.33.226.225', '192', '.225', '.', '225']</p>
  <p>['192.33.226.237', '192', '.237', '.', '237']</p>
  <p>['192.33.12.4', '192', '.4', '.', '4']</p>
  <p><strong>Print(ips)  #index first value as that is the address I need</strong></p>
  <h1>I was expecting something like: ['192.33.12.4', '192.33.12.4', etc]</h1>
  <p>192.33.12.4</p>
  <p>192.33.12.4</p>
  <p>192.32.0.174</p>
  <p>192.32.0.190</p>
  <p>192.33.226.225</p>
  <p>192.33.226.237</p>
  <p>192.33.12.4</p>
  <p><strong>print(list(uniqify(ips)))</strong></p>
  <h1>This is an edited sample output and where I run into a problem with the address format</h1>
  <p>['1', '9', '.', '3', '2', '4']</p>
  <p>['1', '9', '.', '3', '2', '4']</p>
  <p>['1', '9', '.', '3', '2', '7', '4']</p>
  <p>['1', '9', '.', '3', '2', '9']</p>
  <p>['1', '9', '.', '3', '2', '6', '5']</p>
  <p>['1', '9', '.', '3', '2', '6', '7']</p>
  <p>['1', '9 ', '.', '3', '2', '4']</p>