Posted By

sidneydekoning on 05/14/09


Tagged


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

Pingpongbal
kmallea
quan
IsoJon
tspitzr
shuchii


AS3 RegExp: Validate Date of Birth (English / American notation )


 / Published in: ActionScript 3
 

  1. // Validates 10-26-1981, 10/26/1981 and 10.26.1981
  2.  
  3. /(0[1-9]|1[012])[\/](0[1-9]|[12][0-9]|3[01])[\/](19|20)[0-9]{2}/

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: brenjt on December 30, 2010

// Fixed to actually validates dates as such 10.26.1981 and 10-26-1981

/(0[1-9]|1[012])\/|-|.\/|-|.[0-9]{2}/i

Posted By: brenjt on December 30, 2010

Fixed for actual validate of date with periods and dashes

/(0[1-9]|1[012])[\/|-|\.](0[1-9]|[12][0-9]|3[01])[\/|-|\.](19|20)[0-9]{2}/i

You need to login to post a comment.