re.sub
print("Hello World!")
import re
# relative to absolute
strs = '<img id="img_zhaoliying" src="img/zhangliying.png" title="赵丽颖"/>';
ret = re.sub(r'(?P<img><img[^>]+?src=")',"\g<img>http://www.baidu.com/",strs); #count,flags
print(ret)
# add preffix
ret = re.sub(r'(?P<img><img[^>]+?)src',"\g<img>data-src",strs); #count,flags
print(ret)INFO