[問題] matching的問題

看板Perl作者 (可愛中央處理器)時間16年前 (2008/11/05 09:58), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
if( $str=~/$pattern1 | $pattern2/){ # 如果是比對到$pattern1的話 # do blahblahblah # 如果是比對到$pattern2的話 # do other blahblahblah } 問題是:我要怎麼知道是 pattern 1 還是 pattern 2比對成功?? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.248.4.112
文章代碼(AID): #194FseoL (Perl)
討論串 (同標題文章)
文章代碼(AID): #194FseoL (Perl)