equal
deleted
inserted
replaced
121 |
121 |
122 \item Give regular expressions for (a) decimal numbers and for |
122 \item Give regular expressions for (a) decimal numbers and for |
123 (b) binary numbers. Hint: Observe that the empty string |
123 (b) binary numbers. Hint: Observe that the empty string |
124 is not a number. Also observe that leading 0s are |
124 is not a number. Also observe that leading 0s are |
125 normally not written---for example the JSON format for numbers |
125 normally not written---for example the JSON format for numbers |
126 explicitly forbids this. |
126 explicitly forbids this. So 007 is not a number according to JSON. |
127 |
127 |
128 \solution{Just numbers without leading 0s: $0 + (1..9)\cdot(0..1)^*$; |
128 \solution{Just numbers without leading 0s: $0 + (1..9)\cdot(0..1)^*$; |
129 can be extended to decimal; similar for binary numbers |
129 can be extended to decimal; similar for binary numbers |
130 } |
130 } |
131 |
131 |