What is the correct regex statement using re.search() to find and return a file extension in a string.
Such as:
(.+).(avi|rar|zip|txt)
I need it to search a string and if it contains any of those avi, rar, etc) return just that extension.
Thanks!
EDIT: should add that is needs to be case insensitive
.avior do you want to check that a string ends with that? Asking another way, is the string general text "Fred sent me foo.rar today" or is it supposed to contain a file name or path whose extension you want to extract?