From c559f0476d00079b95a4534bcfc907709517b592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 8 Apr 2015 20:10:16 +0200 Subject: [PATCH] Improve regexes in rename.pl --- scripts/rename.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/rename.pl b/scripts/rename.pl index 8489580343..0db312b7da 100755 --- a/scripts/rename.pl +++ b/scripts/rename.pl @@ -38,10 +38,10 @@ for my $name (@names) { $subst{$old} = $new; } -my $string = qr/".*?(??@^_`{|}~\$\/\[\\\]]+|"/; +my $symbols = qr/[-!#$%&'()*+,.\/:;<=>?@[\\\]^_`{|}~]+|"/; # if we replace inside strings, we don't consider them a token my $token = $do_strings ? qr/$space|$idnum|$symbols/ @@ -86,7 +86,7 @@ while( my $filename = shift ) } if( %warnings ) { - print "\nWarning: lines skipped due to unexpected charaacters:\n"; + print "\nWarning: lines skipped due to unexpected characters:\n"; for my $filename (sort keys %warnings) { print "in $filename:\n"; print for @{ $warnings{$filename} };