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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find URL
Expression
^((([hH][tT][tT][pP][sS]?|[fF][tT][pP])\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$
Description
Matches a URL string by: protocol,subdomain,domain,ip address,port number,path and/or filename
Matches
http://regexlib.com | https://regexlib.com:80 | 66.129.120.94/Search.aspx
Non-Matches
http:/regexlib.com | https://regexlib.com:65536 | 66.129.120.256/Search.aspx.
Author Rating: Not yet rated. Dean Dal Bozzo
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

Title: 5 stars, works perfectly. Advanced one ;-)
Name: Casper
Date: 6/10/2011 3:25:43 PM
Comment:
Too bad this only got a rating of 3, while it should be 5! This advanced regex does the job finishing 100 results with 0 fails. What I don't get, is that this is only rated 3, while the easy ones get a rating of 5? Retarded. Be happy someone submitted a complete sample, unthankful bastards... @Maitri, it works for me... No results for 256 ip4


Title: 5 stars, works perfectly. Advanced one ;-)
Name: Casper
Date: 6/10/2011 3:25:28 PM
Comment:
Too bad this only got a rating of 3, while it should be 5! This advanced regex does the job finishing 100 results with 0 fails. What I don't get, is that this is only rated 3, while the easy ones get a rating of 5? Retarded. Be happy someone submitted a complete sample, unthankful bastards... @Maitri, it works for me... No results for 256 ip4


Title: Perfect URL validation
Name: Maitri
Date: 4/14/2009 3:56:49 AM
Comment:
This regex is almost near to perfection. Only error hear is that it allow ip address beyond 255 i.e. This regex allows 256.345.456.567/Search.aspx


Title: Very nice Article
Name: Ajay kumar
Date: 4/19/2007 1:17:00 AM
Comment:
This article help me a lot. Thx


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