OzzyOsbourne has asked for the wisdom of the Perl Monks concerning the following question:
I was using the following code to extract certain files with file::find. It works fine if I name individual files. I thought I'd get slick and try to make it shorter by using mp?? to replace mpeg, mp3, mp2, etc. and I replaced rmj, rmx, etc with rm?.
Problem is, now it doesn't find any of these files. What am I missing?
sub wanted { if (!("$File::Find::dir"=~/}/)&&(/\.asf$|\.mp??$|\.avi$|\.exe$|\.wav$|\.z +ip$|\.mov$|\.rm?$|\.wma$/i)){ print OUTFILE "$_\n"; print "$_\n"; }
Thanks, again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using ? and ?? in regex
by merlyn (Sage) on Apr 26, 2001 at 17:40 UTC | |
|
Re: using ? and ?? in regex
by hdp (Beadle) on Apr 26, 2001 at 17:41 UTC | |
|
Re: using ? and ?? in regex
by suaveant (Parson) on Apr 26, 2001 at 17:43 UTC | |
|
Re: using ? and ?? in regex
by Malkavian (Friar) on Apr 26, 2001 at 17:45 UTC | |
|
Re: using ? and ?? in regex
by diarmuid (Beadle) on Apr 26, 2001 at 17:53 UTC |