RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details A Liberal, Accurate Pattern for Matching URLs
Expression
\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))
Description
Identifies the URLs in an arbitrary string of text, where by “arbitrary” let’s agree we mean something unstructured such as an email message or a tweet. Source: daringfireball.net
Matches
http://foo.com/blah_blah | http://foo.com/blah_blah/ | (Something like http://foo.com/blah_blah) | http://foo.com/blah_blah_(wikipedia) | (Something like http://foo.com/blah_blah_(wikipedia)) | http://foo.com/blah_blah. | http://foo.com/blah_blah/. | <http://foo.com/blah_blah> | <http://foo.com/blah_blah/> | http://foo.com/blah_blah, | http://www.example.com/wpstyle/?p=364. | http://✪df.ws/123 | rdar://1234 | rdar:/1234 | http://userid:password@example.com:8080 | http://userid@example.com | http://userid@example.com:8080 | http://userid:password@example.com
Non-Matches
no_ws.example.com | no_proto_or_ws.com | /relative_resource.php
Author Rating: Not yet rated. Scott C
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials