coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
What I have so far is
I need help with making sure this is the proper or best regex to go about this. I just need the ext, not the filename. I also don't know how to then check to see if $ext is within the array. I know I could do it by using a hash instead but that seems like overkill. Hopefully a foreach() isn't needed.my @quicktime_ext = qw( .sdp .rtsp .rts .mov .qt .smi .sml .smil .avi .vfw .flc.fl +i .wav .bwf .aiff .aif .aifc .cdda .au .snd .ulw .mid .midi .smf .kar .qcp . +sd2 .amr .gsm .mpeg .meg .m2s .m1v .ma1 .m75 .m15 .mpm .mpv .mpa .3gp .3gpp .3 +g2 .3gp2 .mp4 .mpg4 .m4a .m4p .m4b .m4v .sdv .amc .swa .m3u .m3url .swf .fpx . +fpix .dv .dif); my $ext = $url; $ext =~ /$(\..+)/; $ext = $1;
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file extensions
by sh1tn (Priest) on Apr 07, 2005 at 22:57 UTC | |
|
Re: file extensions
by tlm (Prior) on Apr 08, 2005 at 00:21 UTC | |
|
Re: file extensions
by shemp (Deacon) on Apr 07, 2005 at 23:00 UTC | |
|
Re: file extensions
by crashtest (Curate) on Apr 08, 2005 at 00:58 UTC | |
|
Re: file extensions
by TedPride (Priest) on Apr 08, 2005 at 03:31 UTC | |
|
Re: file extensions
by holli (Abbot) on Apr 08, 2005 at 09:04 UTC | |
by cazz (Pilgrim) on Apr 08, 2005 at 20:39 UTC | |
by ambrus (Abbot) on Apr 08, 2005 at 20:41 UTC | |
|
Re: file extensions
by ambrus (Abbot) on Apr 08, 2005 at 08:34 UTC |