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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(http|https|ftp)\://(((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([a-zA-Z0-9_\-\.])+\.(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|uk|me))((:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*)$
Description
First attempt at reg ex - work in progress - can't quite get it to work absolutely correctly so any comments would be great. Matches everything as it should apart from the last part of the IP, i.e. allows http://255.255.255.999 (which obviously it shouldn't but ran out of inspiration) so any corrections humbly and gratefully accepted. TLD check is not complete - just added most of the major ones but easy to dd to if you want to. BTW - you'll need to replace the & with just the ampersand in the reg ex
Matches
http://www.allkins.com | http://255.255.255.255 | http://allkins.com/page.asp?action=1
Non-Matches
http://test.testing
Author Rating: Not yet rated. Dominic Allkins
Source Some from here but the rest is my 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