-
[RESOLVED] RegExp for date YYYY-MM-DD
Hi all,
I am building a application that stores data on MySQL database. Since the column make use of the date format YYYY-MM-DD I must ensure that the user provides the correct format. I am currently using a RegExp with the format MM/DD/YYYY that I got off the Internet.
var dateExpression : RegExp =/^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d$/;
However I do not understand the syntax of the expression to modify it to my needs. Can somebody please shed some light, please!
Many thanks.
-
I figured it out after finding this very helpful site:
http://coursesweb.net/actionscript/r...s-actionscript
So the correct syntax:
var dateExpression : RegExp =/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|