I do this
for fich in ficheros:
coincidencias = re.search(patron, fich)
#print(coincidencias)
if coincidencias:
print("coincide ----------------------->"+fich)
Result
CRC_recup_backup_2018_11_20_004003_1817970.bak
CRC_recup_backup_2018_11_21_004001_6027986.bak
CRC_recup_backup_2018_11_22_004001_7717997.bak
CRC_Test_backup_2018_11_16_004002_9068137.bak
coincide ----------------------->CRC_Test_backup_2018_11_17_004001_5428005.bak
coincide ----------------------->CRC_Test_backup_2018_11_18_004001_6838108.bak
coincide ----------------------->CRC_Test_backup_2018_11_19_004000_9968014.bak
I need to replace the date of those files with today's date newstr = compile_obj.subn('2018_11_22', 0)
what I do not know if within the parenthesis is what I want to substitute or put the value of what I want to replace