Cosmetic: Utilize \Q...\E instead of dumb s/(\W)/\\$1/g as before
[nethome.git] / bin / exx
diff --git a/bin/exx b/bin/exx
index c81dafe..b71de1b 100755 (executable)
--- a/bin/exx
+++ b/bin/exx
@@ -32,8 +32,7 @@ my $origdir=cwd;
 for my $fname (@ARGV) {
        my @parsed;
        for my $fmt (sort { length $b<=>length $a; } keys %{+FORMATS}) {
-               (my $fmtt=$fmt)=~s/(\W)/\\$1/g;
-               last if @parsed=$fname=~m#^(.*?)([^/]+)([.=])($fmtt)$#i;
+               last if @parsed=$fname=~m#^(.*?)([^/]+)([.=])(\Q$fmt\E)$#i;
                }
        $parsed[3] or die "Extension not found for archive: $fname";
        my($path,$base,$ext)=@parsed[0,1,3];