Hi, I have tried 2 questions, could you tell me whether I am right or not?
Regular expression of nonnegative integer constants in C, where numbers beginning with
0
are octal constants and other numbers are decimal constants.I tried
0([1-7][0-7]*)?|[1-9][0-9]*
, is it right? And what string could I match? Do you think034567
will match and000083
match?What is a regular expression for binary numbers x such that hx + ix = jx?
I tried (0|1){32}|1|(10))..
do you think a string like 10
will match and 11
won’t match?
Please tell me whether I am right or not.