我有一个字符串可以是:
test = 'Something Else ( neW ) other and another (nEw ) with (nEw ) '
我需要得到:
result = 'Something Else other and another with '
但到目前为止我取得的最好成绩是:
import re
f = re.findall(ur'\(\s*[nN][eE][wW]\s*\)',test)
for i in f: test = test.replace(i,'')
如何使用findall
来获取与搜索模式不匹配的字符串部分?