This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / I’m using following regular expression to check Excel file: .+\.([x|X][l|L][s|S]) It works but seems not tidy enough. Does any one have better idea?
-deep_blue(BLUE);
2008-8-28
(#4645985@0)
-
what tool? i guess there must be a place to specify match pattern, say, case sensitivity and what not
-win(秋天的菠菜);
2008-8-28
(#4646011@0)
-
good point :)
-deep_blue(BLUE);
2008-8-28
(#4646114@0)
-
i vaguely under the impression that .net and oracle both has this.
-win(秋天的菠菜);
2008-8-28
(#4646123@0)
-
It seems in .NET RegularExpressionValidator, the regular expression options are all turned off by default. So it has to be .+\.[xX][lL][sS] or likewise.
-deep_blue(BLUE);
2008-8-28
(#4646397@0)
-
Regex rx = new Regex(".+\.[x][l][s]", RegexOptions.IgnoreCase);
-mfcguy();
2008-8-28
(#4646808@0)
-
Why not?: Regex rx = new Regex("\.xls$", RegexOptions.IgnoreCase);
-wnms2000(乘风归去);
2008-8-28
(#4646854@0)
-
u r right. "$" should be used here.
-mfcguy();
2008-8-28
(#4646876@0)
-
I didn’t mention it is in RegularExpressionValidator. I cannot use any object. It runs on client-side (actually by JavaScript).
-deep_blue(BLUE);
2008-8-28
(#4647096@0)
-
then leave it is, that's ok, not too ugly:)
-mfcguy();
2008-8-28
(#4647227@0)
-
you can use custom validator and put it javascript using OnClientValidate.
-sunday8(sunday8);
2008-8-28
(#4647379@0)