5
my $test = "There was once an\n ugly ducking";
if ($test =~ m/ugly/g) {
if ($test =~ m/here/g) {
print 'Match';
}
}
在没有输出结果,但在比赛怪异的行为
my $test = "There was once an\n ugly ducking";
if ($test =~ m/here/g) {
if ($test =~ m/ugly/g) {
print 'Match';
}
}
结果!
如果我从正则表达式中删除g标志,那么第二个内部测试将匹配$ test中出现的任何匹配。我无法找到为什么这样的参考。
我觉得很愚蠢! :) – Santrix