顯示廣告
隱藏 ✕
※ 本文為 tomin 轉寄自 tomin.twbbs.org 更新時間: 2011-09-05 22:39:02
看板 coding
作者 tomin (科學大師、哲學博士)
標題 url regex
時間 2011/08/06 Sat 22:33:01


http://daringfireball.net/2010/07/improved_regex_for_matching_urls

(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]
{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\(
[^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?]))

--
  Origin:  Loess Plateau˙黃土高原  tomin.twbbs.org
  Author: tomin 從 i.mdorm.ntnu.edu.tw 發表

--
※ 看板: tomin 文章推薦值: 0 目前人氣: 0 累積人氣: 28 
guest
x)推文 r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇