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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(0|([1-9]\d{0,3}|[1-5]\d{4}|[6][0-5][0-5]([0-2]\d|[3][0-5])))$
Description
Matches TCP port numbers from 0 to 65535. Other than '0', no leading 0's are accepted.
Matches
0 | 1000 | 65535
Non-Matches
65536 | 99999 | 0123
Author Rating: The rating for this expression. Kevin Limperos
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: change
Name: Marta
Date: 12/10/2009 8:07:25 AM
Comment:
How should I change this pattern so numbers from 1024 to 65535 match?


Title: change
Name: Marta
Date: 12/10/2009 7:50:36 AM
Comment:
How should I change this pattern so numbers from 1024 to 65535 match?


Title: change
Name: Marta
Date: 12/10/2009 7:29:47 AM
Comment:
How should I change this pattern so numbers from 1024 to 65535 match?


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