看板 Perl 關於我們 聯絡資訊
正規表示法疑問 請問各位下面這段語法,照理說字串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