regex - Replace all occurences of one word in string in python -


I have this string:

  "tag: tie, tag: ball, tag : Honey "  

I want to replace the" tag "with" "so that I have:

  tie, ball, honey   

I think I should use re.sub but I can not write proper regular expressions.

How do I get it?

Pretty simple:

  s = "tag: tie, tag : Ball, tag: honey "print s.replace (", "")    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -