ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1074. Very Short Problem

Regex!
Posted by Valentin (PSU) 27 Aug 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!
Posted by Olympic Bear (Nikolay Dubchuk) 23 Aug 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"