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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Rather Complete URL regex
Expression
((http(s)?:\/\/)?[a-z0-9-]{3,}(\.[a-z0-9-]{2,})+(:[0-9]+)?((\/[^\/\s.]+\.[^\/\s.,!]+)|(\/[^\/\s.,!]*))*)
Description
This works for valid URLs of all sizes. All slashes have been escaped, replace \/ with / to undo.
Matches
http://google.com, http://google.com/, google.com, https://google.com/, https://www.google.com/imghp?hl=en&tab=wi, http://www.google.com/index.html, http://google.com/samplepage?param=val&p2=val2
Non-Matches
https://www.google.com/index.something.html, http://google.com/samplepage?param=val,&p2=val2, http://google.com/samplepage?param=val!&p2=val2
Author Rating: Not yet rated. Dobri
Source Own Work
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