Perhaps this is what he means:
re.sub("http://[^/]*/","/","http://palle.fi/wing/walla.htm";)
'/wing/walla.htm'
--
http://mail.python.org/mailman/listinfo/python-list
dongdong wrote:
> to Diez B. Roggisch :
> no, I won't to use this way, its efficiency is very low as I need to
> replace all the 'http://mail.python.org/mailman/listinfo/python-list
to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the 'http://mail.python.org/mailman/listinfo/python-list
dongdong wrote:
> is there any lib to help to clear the absolute url in a html file? for
> example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
> should be reserved.
Built-in string-manipulation is your friend:
"abcdef/ghi".replace("abcdef", "")
Diez
--
http://mail.python.org
is there any lib to help to clear the absolute url in a html file? for
example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
should be reserved.
--
http://mail.python.org/mailman/listinfo/python-list