"Darren Dale" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm stuck. I'm trying to make this: > > file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf,file://C > %5Cfolderx%5Cfoldery%5Cmydoc2.pdf > > (no linebreaks) look like this: > > ./mydoc1.pdf,./mydoc2.pdf > > my regular expression abilities are dismal. I won't list all the > unsuccessful things I've tried, in a nutshell, the greedy operators are > messing me up, truncating the output to ./mydoc2.pdf. Could someone offer a > suggestion? > > Thanks, > Darren
from os.path import basename import urllib url = 'file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf' print './%s'%basename(urllib.url2pathname(url)) HTH, Sean -- http://mail.python.org/mailman/listinfo/python-list