[Perl] 纯文本查看 复制代码
#!/usr/bin/perl
$_ = "The network revolution is known as the frourth revolution \nfollowing the agricultural revolution,the industrial revolution \nand the information revolution.\n";
#print "$_";
if (/revolution.*and/) {
print "Ok, it match.\n";
} else {
print "\".*\" can not match the \'\\n\' \n";
}
if (/revolution.*and/s) {
print "OK, it match.\n"
} else {
print "/S can do nothing\n";
}
if (/revolution[\d\D]+and/) {
print "OK, this match too.\n"
} else {
print "can do nothing\n";
}