|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияRegex! Valentin (PSU) 27 авг 2010 18:09 I got AC when add: if (Regex.Match(val, "[\\+\\-]?([0-9]*\\.)?[0-9]+([eE]?[\\+\\-]?[0-9]+)?", RegexOptions.Singleline).Value != val) { Console.WriteLine("Not a floating point number"); } Re: Regex! Olympic Bear (Nikolay Dubchuk) 23 авг 2016 18:22 No, the correct expression is @"^[+-]?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?$" without "?" after [eE] Your expression fails this test: 1+10 0 # The correct answer is "Not a floating point number" |
|
|