舉例:
#!/usr/bin/perl
$str="http://secure.ooo.com.secure.ijm.secure";
if ($num=$str =~/(secure)*/) {
print $num;
}
希望可以印出比對secure的次數
不論是$num=$str =~/(secure)*/
或是$num=$str =~/secure*/
或是$num=$str =~/secure/
$num值都為1..應該是3 囧
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.116.7.236