title: Match string exactly from list of strings
body: <p>I have a list of a device's port numbers that I want to match against but I don't want duplicates and it needs to match exactly.</p>
  
  <p>Here's an example of the list:</p>
  
  <pre><code>port_list = ['port 1.1', 'port 1.2', 'port 1.3', 'port 1.4', 'port 1.5', 
  'port 1.6', 'port 1.7', 'port 1.8', 'port 1.9', 'port 1.10','port 1.11', 
  'port 1.12', 'port 1.13', 'port 1.14', 'port 1.15', 'port 1.16', 'port 1.17', 
  'port 1.18', 'port 1.19', 'port 1.20', 'port 1.21',  'port 1.22','port 1.23', 
  'port 1.24']
  </code></pre>
  
  <p>I found this code that works except for when I have say port 1.23 it matches the correct port but also 1.2 or for port 1.16 I also get a match for port 1.1.</p>
  
  <pre><code>matches = {x for x in port_list if x in output}
  </code></pre>
  
  <p>This is the output I pull the port from in an earlier part of the script</p>
  
  <pre><code>LAB-5150-MES1.NMD*&gt; config search string "virtual-switch ethernet add"
  virtual-switch ethernet add vs 022NMD001111BL port 1.20 vlan 4
  virtual-switch ethernet add vs 022NMD002222BL port 1.21 vlan 20
  virtual-switch ethernet add vs 022NMD003333BL port 1.23 vlan 452
  </code></pre>
  
  <p>Then here's what I'm trying to accomplish with pulling the port from above but it's matching on that extra port.</p>
  
  <pre><code>LAB-5150-MES1.NMD*&gt; lldp set port 1.2 mode tx-rx notification off
  LAB-5150-MES1.NMD*&gt; lldp set port 1.20 mode tx-rx notification off
  LAB-5150-MES1.NMD*&gt; lldp set port 1.23 mode tx-rx notification off
  LAB-5150-MES1.NMD*&gt; lldp set port 1.21 mode tx-rx notification off
  </code></pre>