Hum hum
$file1 = @scriptdir & "\01.08.2022.txt"
$file2 = @scriptdir & "\1.08.2022.txt"
$file3 = @scriptdir & "\1.8.2022.txt"
$file4 = @scriptdir & "\1/8/2022.txt"
$res1 = Execute("'" & StringRegExpReplace($file1, '(\d?\d)\D(\d?\d)\D(\d{4})(\.txt)$', "$3' & StringFormat('%02i', '$2') & StringFormat('%02i', '$1') & '$4' & '") & "'")
Msgbox(0,"1", $res1)
$res2 = Execute("'" & StringRegExpReplace($file2, '(\d?\d)\D(\d?\d)\D(\d{4})(\.txt)$', "$3' & StringFormat('%02i', '$2') & StringFormat('%02i', '$1') & '$4' & '") & "'")
Msgbox(0,"2", $res2)
$res3 = Execute("'" & StringRegExpReplace($file3, '(\d?\d)\D(\d?\d)\D(\d{4})(\.txt)$', "$3' & StringFormat('%02i', '$2') & StringFormat('%02i', '$1') & '$4' & '") & "'")
Msgbox(0,"3", $res3)
$res4 = Execute("'" & StringRegExpReplace($file4, '(\d?\d)\D(\d?\d)\D(\d{4})(\.txt)$', "$3' & StringFormat('%02i', '$2') & StringFormat('%02i', '$1') & '$4' & '") & "'")
Msgbox(0,"4", $res4)