It does not detect files whose extensions contain both upper and lower cases. This is intentional, as if you have part of extension lowercase, you probably intentionally left the other part upper case. Changing this behaviour is trivial. Replace that complex (?:[A-Z]*[0-9]*\.*) with a . (a dot).
2. It then converts them to lowercase.
#!/usr/bin/perl $files=`ls`; @files=split(/\n/,$files); foreach (@files) { if(/(.*)\.((?:[A-Z]*[0-9]*\.*)+)$/) { $name=$1."."."\L$2\E"; system("mv $_ $name") } }
Looks quite ugly, but this is what I could do with the Perl I know, and more importantly, it works (at least in my case)!