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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((?:2[0-5]{2}|1\d{2}|[1-9]\d|[1-9])\.(?:(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)\.){2}(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)):(\d|[1-9]\d|[1-9]\d{2,3}|[1-5]\d{4}|6[0-4]\d{3}|654\d{2}|655[0-2]\d|6553[0-5])$
Description
IPv4 ip:port checker, I hope it will help you. $1 - IP, $2 - port. More to come, maybe :)
Matches
127.0.0.1:80 | 255.255.255.0:21 | 1.0.0.0:1
Non-Matches
0.0.0.0:1 | 256.1.1.1:20 | 127.0.0.1:65536
Author Rating: The rating for this expression. Brano Gerzo
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: good
Name: Alju
Date: 4/19/2007 6:19:52 AM
Comment:
nice


Title: Does not match leading zeros
Name: Hadriel
Date: 10/4/2006 3:03:25 PM
Comment:
Just noting it does not match: 001.002.003.000:0012345 Which may be good for some people, bad for others. Even 0.0.0.0 is a valid IP Address for some purposes, and not for others.


Title: you have right
Name: Brano
Date: 6/8/2005 2:38:50 AM
Comment:
you have right, this was early stage of regexp, so everyone should rewrite it.


Title: Does not find all IPs
Name: A.
Date: 6/7/2005 9:31:53 PM
Comment:
You don't find valid numbers like 247 with 2[0-5]{2} Should be 2[0-4]\d|25[0-5]


Title: Does not work in RegexLib tester
Name: Chris
Date: 12/13/2004 9:54:03 PM
Comment:
see subject


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