ng-pattern for Date in Multiple Formats
<p>I am trying to match an input field to be either MM/dd/yyyy, MM-dd-yyyy, or MMddyyyy.</p>

<p>I am a beginner to regular expressions but I wrote the following:</p>

<pre><code>/^[0-9][0-9][\-\/0-9][0-9][0-9][\-\/0-9][0-9][0-9]([0-9][0-9])/
</code></pre>

<p>This matches both MM/dd/yyyy and MM-dd-yyyy but not MMddyyyy. It would also match just 10 numbers in a row which I don't want. Help would be greatly appreciated.</p>