Re: Regular expression solution

2009-07-28 Thread Brian
On Tue, Jul 28, 2009 at 9:11 PM, tiefeng wu wrote: > 2009/7/29 Nobody : > >> The output should be something like > >> document.write("hello my name is 21c";) > > > > import re > > r = re.compile(r'"\s*\+\s*"') > > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" > n"+"ame"+ > > "

Re: Regular expression solution

2009-07-28 Thread tiefeng wu
2009/7/29 Nobody : >> The output should be something like >> document.write("hello my name is  21c";) > > import re > r = re.compile(r'"\s*\+\s*"') > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" n"+"ame"+ > " is  "+"21c";)''' > r.sub('', s) > Nobody's solution is good. here is m

Re: Regular expression solution

2009-07-28 Thread Nobody
On Tue, 28 Jul 2009 16:12:19 -0700, nickname wrote: > I'm a newbie with python. I am looking to write a regex > program which can take in a piece of text and remove some parts of it > and supply the remaining parts back. > > The input can be something like: > document.write("h" +"e"+