使用Python正则表达式,我想知道如何使用Python Regex匹配以下字符串?
- 如何匹配模式
("Exercises...)
和("Chapter...)
- 如何更换
("Exercises...)
与("Exercises...))
和("Chapter...)
和("Chapter...
。
例如:
("Exercises, 31" "#42")
转化为("Exercises, 31" "#42"))
("Chapter 2 I Positive Borel Measures, 33" "#44")
到("Chapter 2 I Positive Borel Measures, 33" "#44"
感谢和问候!
不完全确定你想做什么......在练习之后添加一个')'并在'章节'之后删除它? – Robus 2011-04-08 18:37:51
@Robus:是的。这就是我想要做的。 – Tim 2011-04-08 18:39:19