Regex fails on the image I provided in the bounty. Extensions are hints and conventions but are often not present.