 <p>HTML 5 has a pattern attribute for the input element, which Paypal implements:</p> <p><code>pattern="(0[1-9]|[12][0-9]|3[01])/(([0][1-9])|([1][0-2]))/((1|2)[0-9]{3})"</code></p> <p>You can find more info on that on the web, for instance this spec on <a href="https://developer.mozilla.org/de/docs/Web/HTML/Element/Input#attr-pattern" rel="nofollow">Mozilla Developer Network</a>.</p>