我无法确定我的正则表达式失败的原因。这是我的代码:
my $email = "rise@dawn.com";
my ($found) = $email =~ /(rise@dawn\.com)/;
print "Found: $found";
这导致输出:
C:\scripts\perl\sandbox>regex.pl
Found: rise.com
如果我转义 @ 符号,那么我根本不会得到任何输出:
my $email = "rise@dawn.com";
my ($found) = $email =~ /(rise\@dawn\.com)/;
print "Found: $found";
C:\scripts\perl\sandbox>regex.pl
Found:
有人可以告诉我我的错误。