/n 阻止 分组元字符()捕获,这是修饰符,在新的5.22 会停止 $1,$2 等填充 对捕获的 不记录到$1,$2,$3中 [Oracle@oadb scan]$ cat a1.pl if ("hello world" =~ /(hi|hello)/){PRint "/$1 is $1/n";};[oracle@oadb scan]$ perl a1.pl $1 is hellocentos6.5:/root/scan#cat a1.pl if ("hello world" =~ /(hi|hello)/n){print "/$1 is $1/n";};centos6.5:/root/scan#perl a1.pl $1 is 这个等同于 放置 ?: 在每个捕获分组的开始centos6.5:/root/scan#cat a2.pl if ("hello world" =~ /(?:hi|hello)/){print "/$1 is $1/n";};centos6.5:/root/scan#perl a2.pl $1 is
新闻热点
疑难解答