./tenkai.pl http://example.com/[7-11].pdf
で
http://example.com/7.pdf http://example.com/8.pdf http://example.com/9.pdf http://example.com/10.pdf http://example.com/11.pdf
に展開するスクリプト
#!/usr/bin/perl $url = $ARGV[0]; $url =~ /^(.*)\[(\d+)\-(\d+)\](.*)$/ or die; $A = $1; @list = $2 .. $3; $C = $4; foreach $B (@list){ print "$A$B$C\n"; }
[07-11].pdf のようなゼロでパディングの形式でも対応可能