62,041
社区成员
发帖
与我相关
我的任务
分享
^(?!^0+(\.0+)?$)\d+(\.\d+)?$
^([1-9]\d+(\.\d+[1-9])?)|(0.\d+[1-9])$
^([1-9]\d+(\.\d+[1-9])?)|(0.\d+[1-9])$
^[1-9]\d*(\.\d+)?$
^(?!^0$)(([1-9]\d*)|0)(\.\d+)?$
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Xml;
namespace CSharpTest
{
class Program
{
static void Main(string[] args)
{
string str=@"12.001";
Regex re = new Regex(@"([1-9]|[1-9][0-9]*)\.\d*[1-9]\d*");
Console.WriteLine(re.Match(str).Value);
}
}
}