title: String matching in python with re
body: <p>I have a file in this structure:</p>
  
  <p><code>009/foo/bar/hi23123/foo/bar231123/foo/bar/yo232131</code></p>
  
  <p>What i need is to find the exact match of a string; e.g. only /foo/bar among /foo/bar/hi and /foo/bar/yo </p>
  
  <p>One solution came up in my mind is like to check for ending "/" for the input string. Because if there is ending "/" in the possible results, that means it got something different than only /foo/bar.</p>
  
  <p>For this solution, I must say that:</p>
  
  <pre><code>input = /foo/bar
  </code></pre>
  
  <p>and</p>
  
  <pre><code>match input without ending "/"
  </code></pre>
  
  <p>How can I do this by Regex in python?</p>
  
  <p>Btw, if there any other solution suggestion, you're welcome to share here. </p>