Regular expression to validate a double number in C#

时间:2016-07-11 21:44:05

标签: c# regex double

I'm using the following regular expression to validate double numbers.

var allowedChars = new Regex(@"^[0-9]*(?:\.[0-9]*)?$");

It seems that the above expression still can not filter the following:

001
1....0
1...
..1
1......01

How can I avoid these?

0 个答案:

没有答案