$ perl -wE' $input = "from \rVBTZ"; $schema = "VBTZ"; if ($input =~ /FROM\s*$schema/i) { say "match" }' match $ perl -wE' $input = "from\r VBTZ"; $schema = "VBTZ"; if ($input =~ /FROM\s*$schema/i) { say "match" }' match