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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$
Description
This validates a number between 1 and 255. Could be modified to IP, or just to verify a number in a range.
Matches
1 | 108 | 255
Non-Matches
01 | 256
Author Rating: Not yet rated. K Thompson
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: Not very practical
Name: user
Date: 6/13/2005 6:11:04 PM
Comment:
Way cleaner; waaaay faster: if(1<=var && var<=255)


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