title: Fileupload Regular expression validation fails for certain file name in asp.net
body: <p>I am using fileupload control to upload file and at same time using regular expression for validating file name.</p>
  
  <p>I want following file extension to be uploaded for <code>.doc, .docx, .pdf</code>  i use following 
  command to valid file name</p>
  
  <p><code>ValidationExpression="[a-zA-Z\\].*(.doc|.DOC|.docx|.DOCX|.pdf|.PDF)$"</code></p>
  
  <pre><code> &lt;asp:FileUpload ID="FileUpload1" runat="server" CssClass="fileUpload" /&gt;
  &lt;asp:RequiredFieldValidator ID="ValidateF1" runat="server"  ErrorMessage="*" CssClass="row-validate"  ControlToValidate="FileUpload1"&gt;&lt;/asp:RequiredFieldValidator&gt;
  &lt;asp:RegularExpressionValidator ID="ValidateEx" runat="server"   ValidationExpression="[a-zA-Z\\].*(.doc|.DOC|.docx|.DOCX|.pdf|.PDF)$" ControlToValidate="FileUpload1" ValidationGroup="Careers" ErrorMessage="*"&gt;&lt;/asp:RegularExpressionValidator&gt;
  </code></pre>
  
  <p>It fails to validate following file name </p>
  
  <p><code>(K)+J01461+abced+high+En+(HR)(1).pdf</code> I am not sure why it fails while it works for <code>ABC_COMPANY_Privacy_v4.0_123456(5).pdf</code></p>
  
  <p>Am i using the wrong validation expression. I want to allow any file name with extension as mentioned above.</p>