Problem in make a date input mask
<p>How do I make a date input masked (hidden) without using a plugin, as followed:</p>

<p><strong>Formating:</strong> <code>YYYY/MM/DD</code> = showing in the input as => <code>____/__/__</code></p>

<p>This is my code that doesn't work:</p>

<pre><code>$('.date_input').delegate("input.date:text", 'keyup', function () {
    //var dateMMDDYYYRegex = '^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$';
    $val = $(this).val().match(/[0-9]/g).reverse().join("").match(/[0-9]{3,3}/g).join("/").match(/./g).reverse().join("");
    $(this).val($val)
});
</code></pre>

<p><a href="http://jsfiddle.net/CMUSD/1/" rel="nofollow">Example of the code</a></p>
