作者deathfullove (Deathful)
看板PHP
標題[請益] 正規表示法
時間Mon Jun 10 23:51:32 2013
以下為一個亂打的網址
http://tw.yahoo.com?http://www.google.com.tw|660|440
現在我想要取得第二個 http開始 到.tw結束
正規表示法該怎麼寫呢?
請大家指導一下
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.240.54.58
※ 編輯: deathfullove 來自: 123.240.54.58 (06/10 23:52)
1F:→ yanli2:可能找不到第二個hppt 06/11 00:04
2F:→ tails32100:hppt XD 06/11 00:05
※ 編輯: deathfullove 來自: 123.240.54.58 (06/11 00:06)
5F:→ deathfullove:網址跟數字是隨機跳動的 只有|660|440 的"|"是固定 06/11 00:10
7F:→ clifflu:$regex = '/^(http:\/\/[\w\d\\\.\?\-_=%#&]+)\|/'; 06/11 01:21