Regex match for optional file extension
I’m extracting portions of URLs from text using a regular expression in Python. The URLs I’m looking for are from a limited set of patterns so it feels like I should just able to handle them in a regex. What I’m trying to extract is the first portion of the file name (“some.file.name” in all the examples below), which can include dots, letters and digits.