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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Easiest URL Link
Expression
(http://|https://)([a-zA-Z0-9]+\.[a-zA-Z0-9\-]+|[a-zA-Z0-9\-]+)\.[a-zA-Z\.]{2,6}(/[a-zA-Z0-9\.\?=/#%&\+-]+|/|)
Description
As always, I couldn't find a regex that worked for me. It only covers full urls with http:// and https://, obviously if you want to add ftp:// then change the first part to: (http://|https://|ftp://) etc..., you get my drift. If you want to cover everything, like short urls, try this site: http://internet.ls-la.net/folklore/url-regexpr.html
Matches
http://www.url.com, http://www.url.com.au, http://www.url.co.nz, http://www.url123.com, http://www.url-123.com, http://www.url.com/, http://www.url.com/page.html, http://www.url.com/page.asp?id=you123&num=%60&pass=big-long+password#anchor
Non-Matches
http://www.url.1com, http://www.url.com.1au
Author Rating: Not yet rated. Oz
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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