- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
(((ht|f)tp(s?):\/\/)|(www\.[^ \[\]\(\)\n\r\t]+)|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})\/)([^ \[\]\(\),;"'<>\n\r\t]+)([^\. \[\]\(\),;"'<>\n\r\t])|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})
v2 A general purpose expresion to find url's (improved). Add heads to first part, example: ((imap:|(ht|f)tp(s?):\/\/)|(www\. to find url's like imap://, so ip's. No ipv6 (yet)
Matches | |
Author Rating: The rating for this expression. James Tikitiki
Your Rating
Bad Good

Enter New 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

Title: Youtube url problem
Name: Yo'Sarin
Date: 4/5/2012 6:54:36 AM
It breaks up url like* into 'http://www.y'

Title: visitor
Name: ktab
Date: 3/11/2012 8:39:23 AM
same problem as Alient and as I can see, this is not solved. I want to use this pattern as mask for my textbox and there are some letters that only typed as upper case (e.g. G, L, N, O, Q, R, T, U) Any solution in this?

Title: Good but sometimes fails
Name: Tom
Date: 10/11/2011 12:53:37 PM
Fails for some that I tried: but works for others of similar length such as

Title: Good but sometimes fails
Name: Tom
Date: 10/11/2011 12:53:11 PM
Fails for some that I tried: but works for others of similar length such as

Title: UpperCase problem after www. keyword
Name: Alient
Date: 10/3/2011 5:57:21 AM
Hey! Hi! it's really great regex and wanna use it for my URI textbox. But There is a problem about case sensitive situation. whatever keyword I write, after "www." when ı started to write the url address, some letters comes as upper case and some comes lower case... it's kind of mixed letters... how can I fix it?

Title: my pattern
Name: bigtall
Date: 11/9/2008 8:09:19 PM
((\w+)\:\/+)?(([\w\-]+(\.[\w\-]+)+)(\:\d+)?)([\w\-\/\.\?;&]+)? this is my pattern

Title: doesnt match
Name: jeff
Date: 6/20/2008 4:35:08 PM
nice expression.. maybe just a tweak to get it to match urls like thanks! :)

Title: Best URL matcher so far
Name: Imbrod
Date: 6/6/2008 6:31:49 PM
This is the best URL matcher so far and I've tried dozens and dozens of regexps seeking for URLs Bravo, James! P.S. You can't expect to match, cause nobody can guess that is URL. In fact, that is not URL. URL is http(s)://(www.) or we can say that URL is URL without the protocol but with the www prefix. Saying that DOMAIN is URL - it just isn't. Look for the domain matches, there are plenty examples on this site.

Title: Not so flexible
Name: Mori
Date: 3/10/2005 2:20:50 PM
Well, still, it won't match or something like that :(

Title: Not as general as it needs to be
Name: Randal L. Schwartz
Date: 2/15/2005 10:24:29 PM
To match a URL, see the CPAN module "URI::Find". Much more complex than what you list.

Copyright © 2001-2018, | ASP.NET Tutorials