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 Validate URL
Expression
^((http://)|(https://))((([a-zA-Z0-9_-]*).?([a-zA-Z0-9_-]*))|(([a-zA-Z0-9_-]*).?([a-zA-Z0-9_-]*).?([a-zA-Z0-9_-]*)))/?([a-zA-Z0-9_/?%=&+#.-~]*)$
Description
A regex I came up with for validating urls, didn't test thoroughly but seems to do the trick.
Matches
http://sportsalert.net, https://www.sportsalert.net, http://sportsalert.net.uk, http://sportsalert.net/index.html, http://sportsalert.net/subdirectory, http://sportsalert.net?var1=param1&var2=param2
Non-Matches
www.sportsalert.net, http://.sportsalert.net, http://sportsalert..net
Author Rating: The rating for this expression. Justin Toth
   Displaying page 1 of 1 pages; Items 1 to 1

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