
Filename pattern matching using regex
I'm using regex in a script that will match a filename. I'm having
problems with one pattern in particular and would like to know what
I'm possibly doing wrong.
The filename that I am searching for will look like this:
504456.08072002.txt
with the first 6 digits always the same, followed by the dot "." then
followed by 8 more digits (date) then ".txt" Seems simple to me.
However, the pattern I'm using is failing on this filename: patrn =
"^504456\.\d{8}\.txt$"
Is there a better way of writing this?
Thanks,
Randy