in reply to Re^4: Regex for files
in thread Regex for files

The original is ambiguous on whether multiple digits are acceptable. If they are, then /^messages(\.|\.\d+)?$/ will work.