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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Days of the Year
Expression
^[1-9]{1}$|^[1-9]{1}[0-9]{1}$|^[1-3]{1}[0-6]{1}[0-5]{1}$|^365$
Description
This expression allows you to select 1-365 as a numeric value for the days of the year. Must be between 1 and 365 and must be numeric
Matches
25 | 363 | 110
Non-Matches
2.5 | 0 | 400
Author Rating: The rating for this expression. Chris Crawford
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: The expression is broken
Name: Brandt
Date: 7/30/2008 3:58:35 PM
Comment:
For 3 digit numbers this expression anything > 6 in the middle digit and >5 in the last digit. This makes 199, 274, and 175 all bad values. It should be this: ^[1-9]$|^[1-9][0-9]$|^[12][0-9][0-9]$|^3[0-6][0-5]$


Title: The expression is broken
Name: Brandt
Date: 7/30/2008 3:58:20 PM
Comment:
For 3 digit numbers this expression anything > 6 in the middle digit and >5 in the last digit. This makes 199, 274, and 175 all bad values. It should be this: ^[1-9]$|^[1-9][0-9]$|^[12][0-9][0-9]$|^3[0-6][0-5]$


Title: The expression is broken
Name: Brandt
Date: 7/30/2008 3:52:43 PM
Comment:
For 3 digit numbers this expression anything > 6 in the middle digit and >5 in the last digit. This makes 199, 274, and 175 all bad values. It should be this: ^[1-9]$|^[1-9][0-9]$|^[12][0-9][0-9]$|^3[0-6][0-5]$


Title: The expression is broken
Name: Brandt
Date: 7/30/2008 3:51:20 PM
Comment:
For 3 digit numbers this expression anything > 6 in the middle digit and >5 in the last digit. This makes 199, 274, and 175 all bad values. It should be this: ^[1-9]$|^[1-9][0-9]$|^[12][0-9][0-9]$|^3[0-6][0-5]$


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