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

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -