I have a file in this structure:
009/foo/bar/hi23123/foo/bar231123/foo/bar/yo232131
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
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.
For this solution, I must say that:
input = /foo/bar
and
match input without ending "/"
How can I do this by Regex in python?
Btw, if there any other solution suggestion, you're welcome to share here.