Possible Duplicate:
Formatting a date in JavaScript
I have a form having lots of fields and all are validate through Java-script and one of them is for date.
<td>Credit Card Expiration Date</td><td>:<input class="input" type="text" name="CC_expiration_date" id="CC_expiration_date"><p>(MM/YY)</p></td>
Now I want that the user must enter the date in (MM/YY) format. How could I validate this using JavaScript?
I tried to make a regular expression:
/^(\d{2})[-\/](\d{2})[-\/](\d{4})$/.exec(date);
... but didnt work.