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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^\d(\d)?(\d)?$
Description
Matches positive whole numbers from 0-999
Matches
0 | 12 | 876
Non-Matches
1000 | 1.23 | -234
Author Rating: Not yet rated.
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: Too simple
Name: Remi Sabourin
Date: 9/23/2003 2:22:08 PM
Comment:
Your regular expression albeit extremely simple and specific matches unwanted padded numbers such as 03 or 027. Here's one that will not match these: ^\d|([1-9]\d)|([1-9]\d\d)$


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