开发者

Regex to catch url in a string [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicates:

Regex to match URL

What is the best regular expression to check if开发者_Go百科 a string is a valid URL

I want to catch urls in strings if any. What is the best regex for this? Urls may or not be abolute.

http://www.blabla.com

http://blabla.com

www.blabla.com

all should match.

Thank you.

\b(https?)://[-A-Z0-9+&@#/%?=~|!:,.;]*[-A-Z0-9+&@#/%=~|]. this regex is enough to some degree but no match for www.blabla.com , so how can i edit to catch the latter either?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜