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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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