title: Why is my Regular Expression not work in ASP.NET
body: <p>I want use a <code>RegularExpressionValidator</code> for a date in this form yyyy-mm-dd (example: 2012-11-29) and here is my expresion:</p>
  
  <blockquote>
    <p>/^(19[789]\d|20[0123]\d)-(0\d|1[012]|\d)-(31|30|[012]\d|\d)$/</p>
  </blockquote>
  
  <p>I test it on <a href="http://www.quanetic.com/Regex" rel="nofollow">http://www.quanetic.com/Regex</a> and it works but if I do this in my asp.net application it doesn't work</p>
  
  <pre><code> &lt;tr&gt;
     &lt;td&gt;Gültig ab:&lt;/td&gt;
     &lt;td&gt;&lt;asp:TextBox ID="txtVon" runat="server" &gt;&lt;/asp:TextBox&gt;&lt;/td&gt;  
     &lt;td&gt;&lt;asp:ImageButton ID="imgVon" runat="server" ImageUrl="images/Calender.ico" Width="15" Height="15" /&gt;
       &lt;asp:CalendarExtender runat="server" ID="E_Von" TargetControlID="txtVon" Format="yyyy-MM-dd" PopupButtonID="imgVon"/&gt;&lt;/td&gt;        
     &lt;td&gt;
       &lt;asp:RequiredFieldValidator ID="ValVon" 
         runat="server" ForeColor="red" 
         ErrorMessage="*" ControlToValidate="txtVon"&gt;&lt;/asp:RequiredFieldValidator&gt;
       &lt;asp:RegularExpressionValidator ID="regVon"   
         runat="server" ControlToValidate="txtVon" 
         ErrorMessage="*Format" ForeColor="red" 
         ValidationExpression="/^(19[789]\d|20[0123]\d)\-(0\d|1[012]|\d)\-(31|30|[012]\d|\d)$/"&gt;&lt;/asp:RegularExpressionValidator&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
  </code></pre>
  
  <p>Where is the error? </p>