I have strings that represent file paths. Something like this.
folder1/folderA/file1.flv folder2/folderB/file1.mp4 folder3/folderC/file1.jpg
I am trying to write an expression that basically matches against a list of valid extensions such as .flv, .mp4, .flv
I am sure I am way off here but here’s what I have .[(\.flv/)|(\.wmv/)|(\.mp4)]
comical, I’m sure… but hopefully shows the gist.
If I interpret it correctly, you probably just want something like:
The
$ensures that it matches at the end of the string/filename. The alternatives are listed in the parens, and the[.]is just a nicer notation for\.