c#正则表达式与正则表达式测试工具结果不同
System.Text.RegularExpressions.Regex.Match("-12323.123232","(0|[1-9][0-9]*)").Groups[0].Value
"12323"
System.Text.RegularExpressions.Regex.Match("12323.123232","(0|[1-9][0-9]*)").Groups[0].Value
"12323"
//以上正解
System.Text.RegularExpressions.Regex.Match("12323.123232","([0-9]*(\\.[0-9]{0,4})?)").Groups[0].Value
"12323.1232"
System.Text.RegularExpressions.Regex.Match("-12323.123232","([0-9]*(\\.[0-9]{0,4})?)").Groups[0].Value
"" //这个,怎么不是12323.1232???
用在线的js正则表达式测试 // tool .oschina .net/ regex/
-12323.123232 匹配:([0-9]*(\.[0-9]{0,4})?),得到12323.1232