string - Replace text, Jython, Regex -


I am processing my website and want to change some things on pages.

I want to replace the following string:

  in & lt; SPAN class = "bold" & gt; And ... & lt; / SPAN & gt; Your right column  

& lt; Span & gt; not tags:

  more in ... column right.  

I would like to replace it with "down" I tried to do this with a simple substitute () in Python, but because in some time the text & lt; Span & gt; tag and does not seem to work on multiple lines. My only idea is to use regular expressions, but I am not with the speed of reggae, can anyone lend a hand?

IF

Assume that the string " Foo "has html text, so to do this will be the code in Python:

  import re # is used to create the dot.DOTALL Match all the characters with the new characters newx Regexp = re.compile ('.more \. \. *. *? Column to your right'. ', Re.Dotal) re.sub (regexp,' below ', foo)  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -