// js /^.+\.(xls)|(xlsx)/.test(filename) // C# Regex regex = new Regex(@"^.+\.(xls)|(xlsx)$"); regex.IsMatch(filename);