作者chrisdar (克里斯)
看板RegExp
標題[請益] 判斷某站網址的正規表達式
時間Sun Nov 25 22:32:52 2007
目前已知 filefront.com 的檔案網址有兩種格式 如下
http://files.filefront.com/DreamWeaverexe/;9096184;/fileinfo.html
http://files.filefront.com/9096184
其中 9096184 必然為7碼數字 DreamWeaverexe 為不定長度字串
謝謝各位的指導
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.75.159
推 qrtt1:抓 domain 後的 / 字串, 全數字是第二種, 其他第一種 11/25 22:37
推 blc:當然這是賭DreamWeaverexe不會是7碼數字就是了,贏面滿大的。 11/25 23:14
寫出來像這樣
http://files.filefront.com/ \w* (?:/;)? \d{7} (?:;/fileinfo.html)?
※ 編輯: chrisdar 來自: 163.23.17.131 (11/27 15:03)