Using Python Regex, I was wondering
("Exercises...)
and ("Chapter...)
("Exercises...)
with ("Exercises...))
, and ("Chapter...)
and ("Chapter...
. For example:
("Exercises, 31" "#42")
is converted to ("Exercises, 31" "#42"))
("Chapter 2 I Positive Borel Measures, 33" "#44")
to ("Chapter 2 I Positive Borel Measures, 33" "#44"
Thanks and regards!
>>> import re
>>> re.sub(r'(\("Exercises.*?\))', r'\1)', '("Exercises, 31" "#42")')
'("Exercises, 31" "#42"))'
>>> re.sub(r'(\("Chapter.*?)\)', r'\1', '("Chapter 2 I Positive Borel Measures, 33" "#44")')
'("Chapter 2 I Positive Borel Measures, 33" "#44"'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.