Re: [問題] 請問如何以regular expression搜尋字串 …

看板Perl作者 (megaman)時間18年前 (2006/11/01 13:09), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
※ 引述《megaman1206 (megaman)》之銘言: : 因為index只能搜尋固定字串 : 如果我要搜尋一個可以由正規表達式表示的多種字串 : 除了每種字串搜尋一次 : 請問還有更快的方法嗎? : 感謝 自問自答 my $ip = "64.156.215.240"; while ($ip =~/(\d+)/g) { printf "found '$1' ending at location %d\n", pos($ip); } 從 Mastering Regular Expressions找到的答案= = -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.155.189
文章代碼(AID): #15I2mEso (Perl)
文章代碼(AID): #15I2mEso (Perl)