/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
新聞熱點
疑難解答