a regual expression problem
arnodel at googlemail.com
Sun Nov 30 10:54:31 CET 2008
lookon <areyoulookon at gmail.com> writes:
> I have a url of image, and I want to get the filename and extension of
> the image. How to write in python?
> for example, the url is http://a.b.com/aaa.jpg?version=1.1
> how can I get aaa and jpg by python?
>>> url=" http://a.b.com/aaa.jpg?version=1.1"
>>> url.rsplit('/', 1).split('?').split('.')
More information about the Python-list