RegularExpressionValidator5.ValidationExpression = @"^.*?.(jpg|docx|bmp|gif)$";
string[] a = F.UPLOADTYPE_.Split(new char[] { ';' });
string STR = "";
foreach (string s in a)
{
if (string.IsNullOrEmpty(s))
continue;
if (s.Length < 4)
{
STR += "[" + s.Substring(0, 1).ToUpper() + s.Substring(0, 1).ToLower() + "][" + s.Substring(1, 1).ToUpper() + s.Substring(1, 1).ToLower() + "][" + s.Substring(2, 1).ToUpper() + s.Substring(2, 1).ToLower() + "]|";
}
else
{
STR += "[" + s.Substring(0, 1).ToUpper() + s.Substring(0, 1).ToLower() + "][" + s.Substring(1, 1).ToUpper() + s.Substring(1, 1).ToLower() + "][" + s.Substring(2, 1).ToUpper() + s.Substring(2, 1).ToLower() + "][" + s.Substring(3, 1).ToUpper() + s.Substring(3, 1).ToLower() + "]|";
// STR += "[" + s.Substring(0, 1).ToUpper() + s.Substring(0, 1).ToLower() + "][" + s.Substring(1, 1).ToUpper() + s.Substring(1, 1).ToLower() + "][" + s.Substring(2, 1).ToUpper() + s.Substring(2, 1).ToLower() + "][" + s.Substring(3, 1).ToUpper() + s.Substring(3, 1).ToLower() + "]|";
}
}
// RegularExpressionValidator5.ValidationExpression = @"[A-Za-z]:\[^:?""><*]*.(" + STR.Substring(0,STR.Length-1) + ")";
// RegularExpressionValidator5.ValidationExpression = @"^.*?.(jpg|docx|bmp|gif)$";
RegularExpressionValidator5.ValidationExpression = @"^.*?.(" + STR.Substring(0, STR.Length - 1) + ")$";