Try these:
import re
re.sub()
re.findall()
re.finditer()
for example:
# Finds all words of length 3 or 4
s = "the quick brown fox jumped over the lazy dogs."
print re.findall(r'w{3,4}', s)
# prints ['the','fox','over','the','lazy','dogs']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…