Perl 中有正则表达式来查找文件扩展名吗?例如,如果我有“test.exe
“,我怎样才能得到”.exe
"?
my $file = "test.exe";
# Match a dot, followed by any number of non-dots until the
# end of the line.
my ($ext) = $file =~ /(\.[^.]+)$/;
print "$ext\n";
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)