perl -wE' my $string = "test"; $string =~ m/(e)/g; # $1 = e $string = "TEST"; say $1; ' E