Regex Hero | The .NET Regular Expression Tester
/
.NET Regex Library
Embedded URL
0
Open in the
Regex Tester
(?xi) \b ( # Capture 1: entire matched URL (?: [a-z][\w-]+: # URL protocol and colon (?: /{1,3} # 1-3 slashes | # -or- [a-z0-9%] # Single letter or digit or '%' # (Trying not to match e.g. ""URI::Escape"") ) | # -or- www\d{0,3}[.] # ""www."", ""www1."", ""www2."" … ""www999."" | # or [a-z0-9.\-]+[.][a-z]{2,4}/ # looks like domain name followed by a slash ) (?: # One or more: [^\s()<>]+ # Run of non-space, non-()<> | # -or- \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels )+ (?: # End with: \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels | # -or- [^\s`!()\[\]{};:'"".,<>?«»“”‘’] # not a space or one of these punct chars ) )
Extracts URLs embedded within other text (e.g. a paragraph of English text).
Mike Strobel
11/19/2010 1:51:16 PM
0 comments so far.
Log in
to leave a comment.
Preview
<< back to
Library
You cannot vote on your own.
(click to dismiss)
You may only vote once.
(click to dismiss)
You must log in to vote.
(click to dismiss)
Regex Hero
Log In
.NET Regex Tester
Reference
Library
Videos
Support