作者ppsy (爱聊天男孩...)
看板perl
标题[问题] 正规表示法疑问
时间Sun Oct 14 16:31:01 2007
正规表示法疑问
请问各位下面这段语法,照理说字串wok次数超过4次应该就要印出"not match"
可是我的执行结果仍出现"match",请问我哪里做错了.谢谢!
-------------------------------------------------------------
my $answer="(wok){2,4}";
while(1)
{
if((my $pattern=<STDIN>)=~/$answer/)
{
print "match\n";
}
else
{
print "not match\n";
}
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.73.236.24