#! perl use strict; my $test = "Fulltext atpublisher"; if($test =~ /Full text at publisher/ix){ print "match!"; }else{ print "/x无法显示空格的匹配"; } 很明显的看到,如果$test中有空格,就会值得加上/x的模式无法进行匹配。 这里想要匹配,必须加上/s匹配空格。