Suppose I have 2 strings:
string1 = "home/lisa/Music/some_files/01.05 - Garden Ground.mp3" string2 = "Music/Jim Smith/Unknown/(Deluxe Version/Garden Ground).mp3" string4 = "Music/Jim Smith/Unknown/00 - Garden Ground.mp3"
Basically, I want to know if string 2 contains the same mp3 file as string 1. In the above example, you can see this is the case with Garden Ground.mp3. What's the best way to go about this? Should I try Levenshtein distance? I thought about doing a regular expression, but there's no guarantee string 2 will be formatted with parentheses in the exact same place every time. In fact, string 2 could look like string 4, for example.