Given a long url or path how do I get the last file extension in it. For example consider these two strings.

```
url = 'https://image.freepik.com/free-vector/vector-chickens-full-emotions_75487-787.jpg?x=2'
path = './image.freepik.com/free-vector/vector-chickens-full-emotions_75487-787.abc.jpg'

```

The last extension is `jpg` and comes after the last `.` and before the following non-alphanumerics or end-of-string.

There are similar questions to mine but I can't find an exact match.