Getting a unknown word out of a list with no spaces

Alexnb alexnbryan at gmail.com
Thu Jul 17 09:34:33 CEST 2008




Alexandr N Zamaraev wrote:
> 
>>>> s = '--a href="/browse/brick"--brick--/a--'
>>>> s
> '--a href="/browse/brick"--brick--/a--'
>>>> ''.join('<%s>' % l if i % 2 == 1 else l for i, l in 
> enumerate(s.split('--')))
> ' /browse/brick brick '
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
> 
> 

I'm sorry, I don't think I was being clear. I replaced the <'s with -- so it
would post online w/o actually making a link. I just need to know how to get
the "brick" out.

-- 
View this message in context: http://www.nabble.com/Getting-a-unknown-word-out-of-a-list-with-no-spaces-tp18502758p18503144.html
Sent from the Python - python-list mailing list archive at Nabble.com.




More information about the Python-list mailing list