This should do for you:
if ($file =~ /^\d{8}((_\d+)*\.ilf|(\s\d+)*\.sht)/i) { ... }
You don't need parens around \d.
Update: What ikegami said about captures vs. grouping. I assumed you were only using the parens for grouping.
In reply to Re: File name regex
by duff
in thread File name regex
by dev2dev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |