View Single Post
Old 10-13-2008, 03:26 AM   #1
DAiki
Junior Member
DAiki began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Oct 2008
Device: PRS 505
Replacing Chars in URL

Hi All,

Not familiar with python at all I need to write regexp or some other way to replace : within the url.

What I have are links like this /story/55571:83405 problem is that parser is taking last five digits as port number while it's actually query string parameter that site is using.

I can not use just use straight replace as that would foul up the http:// bit.

Trying to use this

Code:
def print_version(self, url):
   return re.sub(r'(\d):(\d)','\1/\2',url)
But not luck yet...

Any ideas...

Thanks
DAiki is offline   Reply With Quote