- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
Verifies URLs. Checks for the leading protocol, a good looking domain (two or three letter TLD; no invalid characters in domain) and a somwhat reasonable file path.
Matches | |
Non-Matches | http://www.edsroom/ | http://un/
Author Rating: Not yet rated. Klaxon Mindjammer
Your Rating
Bad Good

Enter New 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: Fails on .info tld
Name: Nigel Gossage
Date: 5/19/2011 11:07:05 AM

Title: Very good
Name: Jefffan24
Date: 1/7/2011 8:25:44 AM
This worked perfect for what I needed.

Title: Allows double period
Name: Kymagic
Date: 11/23/2010 10:40:30 AM
This pattern allows double periods in URLs. For example, is matched.

Title: pattern regular
Name: NguyenMinhTan
Date: 3/20/2010 5:55:51 AM
hi, i want to display all url in a file ( http://....). i can't use regular expression how to match it. may you help me.

Title: Missing backslash in javascript
Name: Stephen Lorimor
Date: 8/17/2008 3:20:57 PM
Firefox 3.0 threw up a warning about this expression that it had unterminated parentheses. As near as I can determine, the final forward slash should be escaped. So it should look like this: ^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?$

Title: simple help
Name: jacob
Date: 10/10/2006 11:50:26 PM
could you tell me how to use this pattern in Javascript? and could you give me a exmaple?

Title: with php
Name: Jorgen Skogmo
Date: 4/19/2004 2:29:03 AM
Thanks! To use it with php, I had to add a "^" at the very end, to stop php complaining about a "missing end delimiter": preg_match( "^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$^", $value ) sweet :)

Title: Doesn't catch subdirectories
Name: Chris
Date: 10/21/2003 7:01:11 PM
Testing for the following fails:

Copyright © 2001-2018, | ASP.NET Tutorials