How can I extract whatever follows the last slash in a URL in Python? For example, these URLs should return the following:
URL: http://www.test.com/TEST1 ret
Here's a more general, regex way of doing this:
re.sub(r'^.+/([^/]+)$', r'\1', url)