I have this string:
url = '/justicefor/404/1nirmala5.jpg'
I want to extract it as 404.jpg
.
I tried something like:
pattern = re.compile(
r"./justicefor/(\d+/.\.\w+)",
re.IGNORECASE
)
But this selects the text between 404 and jpg too. How do I fix this?
I'm new to regular expressions so