First of all '.' in your regex doesn't only match '.' but almost anything
If you have one filename per line and each starting at the beginning of the line, you don't need to constrain your search expression with \w, use the more general '.'
if ( $file =~ /(.+)\.(jpg|JPG|gif|GIF|wmv|WMV|mpg|MPG|avi|AVI)$/ )
In reply to Re: matching and backreferencing filenames
by jethro
in thread matching and backreferencing filenames
by ezekieldas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |