
import re

regex = r"(?<=_)[12]\d{3}_[01]\d_[0123]\d(?=_)"

test_str = ("CRC_recup_backup_2018_11_20_004003_1817970.bak\n"
	"CRC_recup_backup_2018_11_21_004001_6027986.bak\n"
	"CRC_recup_backup_2018_11_22_004001_7717997.bak\n"
	"CRC_Test_backup_2018_11_16_004002_9068137.bak")

subst = "2020_08_09"

# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)

if result:
    print (result)
