Page 1 of 1

Let D be any digit, and N be any digit except 0. Which of the following is a regular expression for all possible strings

Posted: Thu Jul 14, 2022 2:06 pm
by answerhappygod
Let D be any digit, and N be any digit except 0. Which of thefollowing is a regular expression for all possible strings ofcharacters which represent positive real numbers? A positive realnumber must have digits before and after the decimal point, andmust start with 0 only if it is the only digit before the decimalpoint (i.e. 1.5, 0.0, 0.03 are all in the language, but 3, 000.05and 02.6 are not).
(0+ND*).DD*
0N*.D*+D*.D*
(0+ND*).D*
0.D*+ND*.D*