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]|[12][0-9]|3[01])[/ -](0?[1-9]|1[12])[/ -](19[0-9]{2}|[2][0-9][0-9]{2})
Description
Essa expressão é uma validação de data simplicada onde não aceita datas com ano inferior a 1900. Interessante pra validação de data de idade, data atual, etc
Matches
25/11/1979 | 5-12-2004 | 5 2 1901
Non-Matches
25/11/1899 | 9-12-1700 | 25111979
Author Rating: The rating for this expression. Fabiano Santiago
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: October ?
Name: Pazu
Date: 1/31/2015 10:36:09 AM
Comment:
1[012]


Title: Sir
Name: Yves
Date: 11/29/2010 10:00:38 AM
Comment:
Missin caracter 0 in month : (0?[1-9]|1[012])


Title: Não válida nenhuma data com mês = 10
Name: Marcio Rodrigo Pereira
Date: 1/17/2005 7:50:18 AM
Comment:
Da forma como a expressão está, ela não válida nenhuma data cujo o mês seja 10. Uma adequação rápida séria a seguinte: (0?[1-9]|[12][0-9]|3[01])[/ -](0?[1-9]|1[012])[/ -](19[0-9]{2}|[2][0-9][0-9]{2}) [...]'s Marcio Rodrigo Pereira


Title: Bug
Name: Paolo
Date: 10/7/2004 5:24:48 AM
Comment:
I think that I've found a bug here. In fact this regular expression can't match october, because it doesn't match the number '10' for the month. I have modified this in this way: (0?[1-9]|[12][0-9]|3[01])[/ -](0?[1-9]|1[012])[/ -](19[0-9]{2}|[2][0-9]{3}) is this exact? Thanks. Paolo.


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