Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   ValidationExpression (http://www.velocityreviews.com/forums/t91031-validationexpression.html)

=?Utf-8?B?SklNLkgu?= 11-17-2004 10:27 PM

ValidationExpression
 
ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for date
exactly. Taking care of Feb for example?


=?Utf-8?B?UGF0cmljay5PLklnZQ==?= 11-17-2004 10:59 PM

RE: ValidationExpression
 
Check :-http://www.regexlib.com
GDLUCK

"JIM.H." wrote:

> ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for date
> exactly. Taking care of Feb for example?
>


bruce barker 11-17-2004 11:11 PM

Re: ValidationExpression
 
try:

"^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?
:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]
|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])
00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[
6-9]|[2-9]\d)?\d{2})$"


doesn't require leading zero, allows 2 digit years and a date seperator of
"." or "/" or "-". feel free to edit to your needs



-- bruce (sqlwork.com)





"JIM.H." <JIMH@discussions.microsoft.com> wrote in message
news:E4F596C1-AEDD-4324-AF92-E3CA813B41CC@microsoft.com...
| ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
date
| exactly. Taking care of Feb for example?
|



=?Utf-8?B?UGF0cmljay5PLklnZQ==?= 11-18-2004 12:48 AM

Re: ValidationExpression
 
Hi Bruce..
What about if i want to validate an email like:-
code@code.com.jp?



"bruce barker" wrote:

> try:
>
> "^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?
> :29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]
> |[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])
> 00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[
> 6-9]|[2-9]\d)?\d{2})$"
>
>
> doesn't require leading zero, allows 2 digit years and a date seperator of
> "." or "/" or "-". feel free to edit to your needs
>
>
>
> -- bruce (sqlwork.com)
>
>
>
>
>
> "JIM.H." <JIMH@discussions.microsoft.com> wrote in message
> news:E4F596C1-AEDD-4324-AF92-E3CA813B41CC@microsoft.com...
> | ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
> date
> | exactly. Taking care of Feb for example?
> |
>
>
>


Peter Blum 11-18-2004 05:45 PM

Re: ValidationExpression
 
<flame>I wish Microsoft would do a better job documenting the purpose of the
CompareValidator because this question appears regularly!</flame>

The CompareValidator validates the format of dates, integers, and currency.
It handles dates exactly the way you need. Just set its Operator to
DataTypeCheck and Type to the desired format.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"JIM.H." <JIMH@discussions.microsoft.com> wrote in message
news:E4F596C1-AEDD-4324-AF92-E3CA813B41CC@microsoft.com...
> ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
> date
> exactly. Taking care of Feb for example?
>





All times are GMT. The time now is 12:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.