Python正则反向引用

str2 ="2018-10-29"
c =re.sub(r"(d{4})-(d{2})-(d{2})","g<1>/g<2>/g<3>",str2)
print(c)
原文地址:https://www.cnblogs.com/leigepython/p/9883767.html