import re
m = re.search(r'd+$', string)
# if the string ends in digits m will be a Match object, or None otherwise.
if m is not None:
print m.group()
d
matches a numerical digit, d+
means match one-or-more digits (greedy: match as many consecutive as possible). And $
means match the end of the string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…