1
private static Regex regex_Unsigned_Integer = new Regex("^(([0-9]{1})|([1-9][0-9]+))$");
private static Regex regex_Signed_Integer = new Regex("^([+|-]?)(([0-9]{1})|([1-9][0-9]+))$");
private static Regex regex_Unsigned_Factor = new Regex("^(([0-9]+[/][1-9]{1}[0-9]*)|([1-9]{1}[0-9]*['][1-9]+[/][1-9]{1}[0-9]*))$");
private static Regex regex_Signed_Factor = new Regex("^([+|-]?)(([0-9]+[/][1-9]{1}[0-9]*)|([1-9]{1}[0-9]*['][1-9]+[/][1-9]{1}[0-9]*))$");
private static Regex regex_Unsigned_Decimal = new Regex("^((([0-9]{1})|([1-9]{1}[0-9]+))[.][0-9]+)$");
private static Regex regex_Signed_Decimal = new Regex("^([+|-]?)((([0-9]{1})|([1-9]{1}[0-9]+))[.][0-9]+)$");
- 我想匹配,有些号码与正则表达式,如(1),(-1.3),1'3/7,(+3) ,3;
- 但是,它包含一个特殊的条件,即只有带符号的数字应该用括号括起来;
- Illegde串:(3),-3,+ 1'3/7
- 正确的字符串:3,(-3),(+ 1'3/7)
- 因此,我必须构造6 .NET中的正则表达式如下:
正则表达式是否包含一些规则来匹配只有带符号数字应该用括号括起来的条件。在.NET条件判断正则表达式
THX