4 ms·
Or more concrete do: s = """ But I must explain to you how all this mistaken idea of denouncing pleasure and expound the actual teachings of the great ex
by lixtra 8y ago
Or more concrete do:
s = """
But I must explain to you how all this mistaken idea of denouncing pleasure and
expound the actual teachings of the great explorer of the truth, the #endnote-1
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure
#endnote-10 advantage from it? But who has any right to find fault with a man
that produces no resultant pleasure?
"""
import re
def bump(match):
return '#endnote-{}'.format(int(match.group(1))+1)
r = re.sub(r'#endnote-(\d+)', bump, s)
print(r)