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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find URL validation .NET URLvalidation
Expression
^(ht|f)tp(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?([\d\w\.\/\%\+\-\=\&\?\:\\\"\'\,\|\~\;]*)$
Description
Validates URL to see if the input pattern is a valid URL (ftp, http, https, etc); can be easily modified to support others such as file:/// | Pattern has been tested using .NET runtime engine | localhost literal support for windows IIS server and visal studio (2005 or later) built-in asp.net web-server
Matches
http://regexlib.com | http://www.google.com | ftp://teach.me.regex/checkpattern/o | http://www.google.com/search?hl=en&source=hp&q=asp.net | https://secure.mailserver.com | http://localhost/mypage.html | http://localhost:89783/mypage.aspx | http://go.com | http://forum.whoisyourdaddy.org/index.html?RegID=7449046&Daddy=dontknow&son=me
Non-Matches
http:// | http://whoisyourdaddy | httpOrhttpsOrftp.com
Author Rating: The rating for this expression. Eric Wai Chan
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: Do not use -- vulnerable to REDOS
Name: James C. Davis
Date: 3/17/2018 2:25:24 AM
Comment:
This regex is vulnerable to REDOS. "stringLenFor10Sec" : 766, "attackFormat" : { "pumpPairs" : [ { "pump" : ".a", "prefix" : "https://a" }, { "pump" : "a", "prefix" : "a" }, { "prefix" : "a", "pump" : "a" } ], "suffix" : "s:$" }, "stringLenFor10Sec" : 766, "attackFormat" : { "pumpPairs" : [ { "pump" : ".a", "prefix" : "https://a" }, { "pump" : "a", "prefix" : "a" }, { "prefix" : "a", "pump" : "a" } ], "suffix" : "s:$" }, "nPumpsFor10Sec" : "188", "nPumpsFor10Sec" : "188",


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