$q =~ s/^.*$a//sm; #### $q =~ s/.*$a//s; #### #!/usr/bin/env perl use strict; use warnings; use Test::More tests => 1; my $q = 'qqqweqwe asdasdasd zxczxczxc tyutyutyi '; my $a = 'zxczxczxc'; my $want = "\ntyutyutyi\n"; $q =~ s/.*$a//s; is ($q, $want, "With /s only and no anchor - matched");