ASP.NET 1.1及2.0的RegularExpressionValidator都無法指定是否區分大小寫(RegexOptions.IgnoreCase)。
要檢查上傳的副檔名,其正規表示式如下^[a-zA-Z]:(\\.+)(\.pps|\.sql|\.dat)$
為處理大小寫須改成^[a-zA-Z]:(\\.+)(\.[pP][pP][sS]|\.[sS][qQ][lL]|\.[dD][aA][tT])$
可用程式filter = "\.ppt|\.sql|\.dat";
for ( int i='a'; i<='z' ; i++ )
{
string ls = new string((char)i,1);
string us = new string((char)(i-32),1);
filter = filter.Replace(ls,"["+ls+us+"]");
} // for
RegularExpressionValidator1.ValidationExpression = @"^[a-zA-Z]:(\\.+)("+filter+")$";
2 Responses to RegularExpressionValidator無法區分大小寫
xanax no prescription drug test results for xanax - xanax 2 mg extended release
jordan 11
curry 4
golden gooses
golden goose outlet
air max 2018
polo ralph lauren
canada goose jacket
jordan shoes
timberlands
kobe shoes
Something to say?