It is not possible with RegularExpression validator. You will need to use CustomValidator and JavaScript
<asp:FileUpload ID="FileUpload1" runat="server" AllowMultiple="true" />
<asp:Button Text="Upload" runat="server" />
<asp:CustomValidator ID="CustomValidator1" runat="server" ForeColor ="Red" ErrorMessage="CustomValidator" ControlToValidate ="FileUpload1" ClientValidationFunction ="ValidateFileExtension"></asp:CustomValidator>
<script type="text/javascript">
var validFilesTypes = ["docx", "pdf"];
function ValidateFileExtension(sender, args) {
var fileUpload = document.getElementById(sender.controltovalidate);
var hasValidFile = true;
var paths = fileUpload.value.split(',');
for (var i = 0; i < paths.length; i++) {
var ext = paths[i].substring(paths[i].lastIndexOf(".") + 1, paths[i].length).toLowerCase();
var isValidFile = false;
for (var j = 0; j < validFilesTypes.length; j++) {
if (ext == validFilesTypes[j]) {
isValidFile = true;
break;
}
}
if (!isValidFile) {
hasValidFile = false;
break;
}
}
if (!hasValidFile) {
sender.innerHTML = "Invalid File. Please upload a File with" +
" extension:\n\n" + validFilesTypes.join(", ");
}
args.IsValid = hasValidFile;
}
</script>
Screenshot
![](https://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=bbb176ac-05ad-4d56-b931-28aace4d55b3.gif)