2016-03-08 44 views

回答

0

試試這個:

http(s)?:\/\/([\w-]+\.)+[\w-]+(\/)?[.a-z0-9/-]+ 

你也可以檢查此related thread其中馬修奧賴爾登給正則表達式來驗證網址:

/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w][email protected])?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w][email protected])[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/ 
相關問題