Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2007, 08:55 AM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validating date(yyyymmdd) with RegularExpressionVa


Hi,

How can I validate user date entry in yyyymmdd format with RegularExpressionValidator.

Any comment is appreciated.

belete

 
Old October 23rd, 2007, 06:11 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubhav.kumar
Default

Hi,

Not exactly what u need, but the below expression will validate YYMMDD format

^((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229)$

I am not a regEx geek, so cannot modify it for youer needs, but hope it helps.

Please refer to
http://regexlib.com/Search.aspx?k=date

Anubhav Kumar
 
Old October 23rd, 2007, 12:30 PM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you! it helps me a lot!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating date abhishekkashyap27 Javascript How-To 2 May 5th, 2008 06:46 AM
date format yyyymmdd belete ASP.NET 2.0 Basics 5 October 29th, 2007 08:24 AM
Validating future date skev Infopath 0 October 2nd, 2007 04:17 AM
validating date of birth in asp shoakat Classic ASP Databases 7 September 3rd, 2004 12:18 AM
Validating XML sunilyenpure XML 3 July 13th, 2004 12:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.