Примечание: я предположил, что ваше "имя файла" будет только буквенно-цифровым (ASCII).
Мой лучший друг RegexBuddy говорит:
[a-zA-Z0-9]+?\.(19|20)[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])
Совпадения
filename123.20101118
FOOBAR123.19961212
Не соответствует
FOOBAR.88881201
foobar.20103512
filename.20101235
Отказ от ответственности: Я просто счастливый пользователь ине имеет никакого отношения к РБ
Пояснение
[a-zA-Z0-9]+?\.(19|20)[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])
Options: case insensitive
Match a single character present in the list below «[a-zA-Z0-9]+?»
Between one and unlimited times, as few times as possible, expanding as needed (lazy) «+?»
A character in the range between “a” and “z” «a-z»
A character in the range between “A” and “Z” «A-Z»
A character in the range between “0” and “9” «0-9»
Match the character “.” literally «\.»
Match the regular expression below and capture its match into backreference number 1 «(19|20)»
Match either the regular expression below (attempting the next alternative only if this one fails) «19»
Match the characters “19” literally «19»
Or match regular expression number 2 below (the entire group fails if this one fails to match) «20»
Match the characters “20” literally «20»
Match a single character in the range between “0” and “9” «[0-9]{2}»
Exactly 2 times «{2}»
Match the regular expression below and capture its match into backreference number 2 «(0[1-9]|1[012])»
Match either the regular expression below (attempting the next alternative only if this one fails) «0[1-9]»
Match the character “0” literally «0»
Match a single character in the range between “1” and “9” «[1-9]»
Or match regular expression number 2 below (the entire group fails if this one fails to match) «1[012]»
Match the character “1” literally «1»
Match a single character present in the list “012” «[012]»
Match the regular expression below and capture its match into backreference number 3 «(0[1-9]|[12][0-9]|3[01])»
Match either the regular expression below (attempting the next alternative only if this one fails) «0[1-9]»
Match the character “0” literally «0»
Match a single character in the range between “1” and “9” «[1-9]»
Or match regular expression number 2 below (attempting the next alternative only if this one fails) «[12][0-9]»
Match a single character present in the list “12” «[12]»
Match a single character in the range between “0” and “9” «[0-9]»
Or match regular expression number 3 below (the entire group fails if this one fails to match) «3[01]»
Match the character “3” literally «3»
Match a single character present in the list “01” «[01]»
Created with RegexBuddy